Advertisement
fidless

Untitled

Oct 27th, 2019
724
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 44.49 KB | None | 0 0
  1. //=============================================================================
  2. // MOG_FastTravel.js
  3. //=============================================================================
  4. /*:
  5. * @plugindesc (v1.1) Sistema de mapa de teleporte rápido.
  6. * @author Moghunter
  7. *
  8. * @param Remember Last MapID
  9. * @desc Lembrar da último mapa teleportado.
  10. * @default true
  11. *
  12. * @param Play Bgm
  13. * @desc Ativar música.
  14. * @default false
  15. *
  16. * @param Bgm File Name
  17. * @desc Definição do nome da música.
  18. * @default Theme2
  19. *
  20. * @param Fade Bgm
  21. * @desc Ativar fade na música durante a transição.
  22. * @default true
  23. *
  24. * @param Map Move Speed
  25. * @desc Definição da velocidade de movimento do mapa.
  26. * @default 0
  27. *
  28. * @param Center X-axis
  29. * @desc Definição do centro do tela (Para ajustes).
  30. * @default 643
  31. *
  32. * @param Center Y-axis
  33. * @desc Definição do centro do tela (Para ajustes).
  34. * @default 362
  35. *
  36. * @param Fade Speed
  37. * @desc Definição da velocidade da transição.
  38. * @default 0
  39. *
  40. * @param Zoom Animation
  41. * @desc Ativar o efeito de zoom.
  42. * @default true
  43. *
  44. * @param Rotation Animation
  45. * @desc Ativar o efeito de rotação.
  46. * @default true
  47. *
  48. * @param New Map Color
  49. * @desc Definição da cor dos mapas novos.
  50. * @default 6
  51. *
  52. * @param Turn Back After Cancel
  53. * @desc Virar para traz após cancelar a cena.
  54. * @default true
  55. *
  56. * @param List Width
  57. * @desc Definição da largura da janela da lista.
  58. * @default 300
  59. *
  60. * @param List Height
  61. * @desc Definição da altura da janela da lista.
  62. * @default 290
  63. *
  64. * @param List X-axis
  65. * @desc Definição X-axis da janela da lista.
  66. * @default 516
  67. *
  68. * @param List Y-axis
  69. * @desc Definição Y-axis da janela da lista.
  70. * @default 145
  71. *
  72. * @param Slide List
  73. * @desc Ativar o efeito de animação de deslize.
  74. * @default true
  75. *
  76. * @param List Layout X-axis
  77. * @desc Definição X-axis do layout da janela da lista.
  78. * @default 0
  79. *
  80. * @param List Layout Y-axis
  81. * @desc Definição Y-axis do layout da lista.
  82. * @default -53
  83. *
  84. * @param Description X-axis
  85. * @desc Definição X-axis da descrição.
  86. * @default 160
  87. *
  88. * @param Description Y-axis
  89. * @desc Definição Y-axis da descrição.
  90. * @default 300
  91. *
  92. * @param Slide Description
  93. * @desc Ativar o efeito de animação de deslize.
  94. * @default true
  95. *
  96. * @param Com Town X-axis
  97. * @desc Definição X-axis do comando Town.
  98. * @default 470
  99. *
  100. * @param Com Town Y-axis
  101. * @desc Definição Y-axis do comando Town.
  102. * @default 7
  103. *
  104. * @param Com Dungeon X-axis
  105. * @desc Definição X-axis do comando Dungeon.
  106. * @default 575
  107. *
  108. * @param Com Dungeon Y-axis
  109. * @desc Definição Y-axis do comando Dungeon.
  110. * @default 7
  111. *
  112. * @param Com Other X-axis
  113. * @desc Definição X-axis do comando Other.
  114. * @default 710
  115. *
  116. * @param Com Other Y-axis
  117. * @desc Definição Y-axis do comando Other.
  118. * @default 7
  119. *
  120. * @param Com Cursor X-axis
  121. * @desc Definição X-axis do cursor Command.
  122. * @default 0
  123. *
  124. * @param Com Cursor Y-axis
  125. * @desc Definição Y-axis do cursor Command.
  126. * @default 0
  127. *
  128. * @param Com Cursor Animation
  129. * @desc Ativar animação no cursor.
  130. * @default true
  131. *
  132. * @param Next Cursor X-axis
  133. * @desc Definição X-axis do cursor Next.
  134. * @default 0
  135. *
  136. * @param Next Cursor Y-axis
  137. * @desc Definição Y-axis do cursor Next.
  138. * @default 0
  139. *
  140. * @param Next Cursor Animation
  141. * @desc Ativar animação no cursor.
  142. * @default true
  143. *
  144. * @param Show Completion
  145. * @desc Apresentar a porcentagem de mapas descobertos.
  146. * @default true
  147. *
  148. * @param Completion X-axis
  149. * @desc Definição X-axis do Completion.
  150. * @default 590
  151. *
  152. * @param Completion Y-axis
  153. * @desc Definição Y-axis do Completion.
  154. * @default 513
  155. *
  156. * @param Completion Font Size
  157. * @desc Definição do tamanho da fonte.
  158. * @default 22
  159. *
  160. * @help
  161. * =============================================================================
  162. * +++ MOG - Fast Travel (v1.1) +++
  163. * By Moghunter
  164. * https://atelierrgss.wordpress.com/
  165. * =============================================================================
  166. * Sistema de mapa de teleporte rápido.
  167. *
  168. * =============================================================================
  169. * UTILIZAÇÃO
  170. * =============================================================================
  171. * Grave as imagens do sistema na pasta.
  172. *
  173. * /img/fasttravel/
  174. *
  175. * As imagens das descrições dos mapas deverão ser gravadas na pasta
  176. *
  177. * /img/fasttravel/stages/
  178. *
  179. * Os nomes dos arquivos deverão ter o mesmo nome do mapa definido através do
  180. * plugin.
  181. *
  182. * =============================================================================
  183. * PLUGIN COMMAND
  184. * =============================================================================
  185. * Para ativar a cena do Fast Travel use o comando abaixo.
  186. *
  187. * fast_travel
  188. *
  189. * Para ativar ou desativar um mapa utilize um dos códigos abaixo.
  190. *
  191. * enable_town : ID
  192. * disable_town : ID
  193. *
  194. * enable_dungeon : ID
  195. * disbale_dungeon : ID
  196. *
  197. * enable_other : ID
  198. * disable_other : ID
  199. *
  200. * =============================================================================
  201. * HISTÓRICO
  202. * =============================================================================
  203. * (v1.1) - Correção de não ativar o sistema quando o plugin é usado stand-alone.
  204. *
  205. */
  206. // ☢CAUTION!!☢ Don't Touch.^_^ ----------------------------------------
  207.   var Imported = Imported || {};
  208.   Imported.MOG_FastTravel = true;
  209.   var Moghunter = Moghunter || {};
  210. Moghunter.fastTravel_Towns = [];
  211. Moghunter.fastTravelDungeons = [];
  212. Moghunter.fastTravelOther = [];
  213. // ☢CAUTION!!☢ Don't Touch.^_^ ----------------------------------------
  214.  
  215.  
  216.  
  217.  
  218. //*****************************************************************************
  219. // ** SETUP *******************************************************************
  220. //*****************************************************************************
  221. // Para configurar um mapa siga o seguinte exemplo.
  222. //
  223. // Moghunter.fastTravel_Towns[A] = {B,C,D,E,F,G,H};
  224. //
  225. // A - Point ID
  226. // B - Map Name
  227. // C - X-axis of the map point.
  228. // D - Y-axis of the map point.
  229. // E - ID of the map to be telepotado.
  230. // F - X-axis of the map to be teleported.
  231. // G - Y-axis of the map to be teleported.
  232. // H - Direction. (2 - Down / 4 - Left / 6 - Right / 8 - Up)
  233. //
  234. //*****************************************************************************
  235.  
  236.  
  237.  
  238. //=============================================================================
  239. // ** Town (town command)
  240. //=============================================================================
  241. Moghunter.fastTravel_Towns[1] = {name:"The Red Petal",x:643,y:362,mapID:12,mapX:0,mapY:9,direction:2};
  242. Moghunter.fastTravel_Towns[2] = {name:"Sacred shrine",x:643,y:362,mapID:80,mapX:0,mapY:9,direction:2};
  243.  
  244. //=============================================================================
  245. // ** Shops (dungeon command)
  246. //=============================================================================
  247. Moghunter.fastTravelDungeons[1] = {name:"General store",x:643,y:362,mapID:6,mapX:0,mapY:9,direction:2};
  248.  
  249. //=============================================================================
  250. // ** Other
  251. //=============================================================================
  252. Moghunter.fastTravelOther[1] = {name:"Alice's Magic Shop",x:643,y:362,mapID:19,mapX:0,mapY:9,direction:2};
  253.  
  254.  
  255. //*****************************************************************************
  256. // ** SETUP *******************************************************************
  257. //*****************************************************************************
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265. //=============================================================================
  266. // ** PLUGIN PARAMETERS
  267. //=============================================================================
  268.  
  269.  Moghunter.parameters = PluginManager.parameters('MOG_FastTravel');
  270. Moghunter.fastTravel_lastIndex = String(Moghunter.parameters['Remember Last MapID'] || "true");
  271. Moghunter.fastTravel_playBgm = String(Moghunter.parameters['Play Bgm'] || "false");
  272. Moghunter.fastTravel_BgmFileName = String(Moghunter.parameters['Bgm File Name'] || "Theme2");
  273. Moghunter.fastTravel_fadeBgm = String(Moghunter.parameters['Fade Bgm'] || "true");
  274. Moghunter.fastTravel_MapMoveSpeed = Number(Moghunter.parameters['Map Move Speed'] || 30);
  275. Moghunter.fastTravel_fadeSpeed = Number(Moghunter.parameters['Fade Speed'] || 30);
  276. Moghunter.fastTravel_zoomAnime = String(Moghunter.parameters['Zoom Animation'] || "true");
  277. Moghunter.fastTravel_rotationAnime = String(Moghunter.parameters['Rotation Animation'] || "true");
  278. Moghunter.fastTravel_CenterX = Number(Moghunter.parameters['Center X-axis'] || 1280);
  279. Moghunter.fastTravel_CenterY = Number(Moghunter.parameters['Center Y-axis'] || 720);
  280. Moghunter.fastTravel_ListWidth = Number(Moghunter.parameters['List Width'] || 300);
  281. Moghunter.fastTravel_ListHeight = Number(Moghunter.parameters['List Height'] || 290);
  282. Moghunter.fastTravel_ListX = Number(Moghunter.parameters['List X-axis'] || 516);
  283. Moghunter.fastTravel_ListY = Number(Moghunter.parameters['List Y-axis'] || 145);
  284. Moghunter.fastTravel_ListSlide = String(Moghunter.parameters['Slide List'] || "true");
  285. Moghunter.fastTravel_ListLayoutX = Number(Moghunter.parameters['List Layout X-axis'] || 0);
  286. Moghunter.fastTravel_ListLayoutY = Number(Moghunter.parameters['List Layout Y-axis'] || -53);
  287. Moghunter.fastTravel_prevSlide = String(Moghunter.parameters['Slide Description'] || "true");
  288. Moghunter.fastTravel_Prev_X = Number(Moghunter.parameters['Description X-axis'] || 160);
  289. Moghunter.fastTravel_Prev_Y = Number(Moghunter.parameters['Description Y-axis'] || 300);
  290. Moghunter.fastTravel_ComA_X = Number(Moghunter.parameters['Com Town X-axis'] || 470);
  291. Moghunter.fastTravel_ComA_Y = Number(Moghunter.parameters['Com Town Y-axis'] || 7);
  292. Moghunter.fastTravel_ComB_X = Number(Moghunter.parameters['Com Dungeon X-axis'] || 575);
  293. Moghunter.fastTravel_ComB_Y = Number(Moghunter.parameters['Com Dungeon Y-axis'] || 7);
  294. Moghunter.fastTravel_ComC_X = Number(Moghunter.parameters['Com Other X-axis'] || 710);
  295. Moghunter.fastTravel_ComC_Y = Number(Moghunter.parameters['Com Other Y-axis'] || 7);
  296. Moghunter.fastTravel_CursorX = Number(Moghunter.parameters['Com Cursor X-Axis'] || 0);
  297. Moghunter.fastTravel_CursorY = Number(Moghunter.parameters['Com Cursor Y-Axis'] || 0);
  298. Moghunter.fastTravel_CursorFloat = String(Moghunter.parameters['Com Cursor Animation'] || "true");
  299. Moghunter.fastTravel_CursorBX = Number(Moghunter.parameters['Next Cursor X-Axis'] || 0);
  300. Moghunter.fastTravel_CursorBY = Number(Moghunter.parameters['Next Cursor Y-Axis'] || 0);
  301. Moghunter.fastTravel_CursorBFloat = String(Moghunter.parameters['Next Cursor Animation'] || "true");
  302. Moghunter.fastTravel_Comp_Show = String(Moghunter.parameters['Show Completion'] || "true");
  303. Moghunter.fastTravel_Comp_X = Number(Moghunter.parameters['Completion X-Axis'] || 590);
  304. Moghunter.fastTravel_Comp_Y = Number(Moghunter.parameters['Completion Y-Axis'] || 513);
  305. Moghunter.fastTravel_Comp_FontSize = Number(Moghunter.parameters['Completion Font Size'] || 22);
  306. Moghunter.fastTravelNewColor = Number(Moghunter.parameters['New Map Color'] || 6);
  307. Moghunter.fastTravel_directionCancel = String(Moghunter.parameters['Turn Back After Cancel'] || "true");
  308. //=============================================================================
  309. // ** ImageManager
  310. //=============================================================================
  311.  
  312. //==============================
  313. // * Fast Travel
  314. //==============================
  315. ImageManager.loadfasttravel = function(filename) {
  316. return this.loadBitmap('img/fasttravel/', filename, 0, true);
  317. };
  318.  
  319. //==============================
  320. // * Stages
  321. //==============================
  322. ImageManager.loadfasttravelstages = function(filename) {
  323. return this.loadBitmap('img/fasttravel/stages/', filename, 0, true);
  324. };
  325.  
  326. //=============================================================================
  327. // ** Game_Interpreter
  328. //=============================================================================
  329.  
  330. //==============================
  331. // * PluginCommand
  332. //==============================
  333. var _mog_fastravel_pluginCommand = Game_Interpreter.prototype.pluginCommand
  334. Game_Interpreter.prototype.pluginCommand = function(command, args) {
  335. _mog_fastravel_pluginCommand.call(this,command, args)
  336. if (command === "fast_travel") {
  337. SceneManager.push(SceneFastTravel);
  338. this.wait(10);
  339. } else if (command === "enable_town") {
  340. if ($gameSystem._fastTravelTowns[Number(args[1])]) {
  341. $gameSystem._fastTravelTowns[Number(args[1])][0] = true;
  342. };
  343. } else if (command === "disable_town") {
  344. if ($gameSystem._fastTravelTowns[Number(args[1])]) {
  345. $gameSystem._fastTravelTowns[Number(args[1])][0] = false;
  346. };
  347. } else if (command === "enable_dungeon") {
  348. if ($gameSystem._fastTravelDungeons[Number(args[1])]) {
  349. $gameSystem._fastTravelDungeons[Number(args[1])][0] = true;
  350. };
  351. } else if (command === "disable_dungeon") {
  352. if ($gameSystem._fastTravelDungeons[Number(args[1])]) {
  353. $gameSystem._fastTravelDungeons[Number(args[1])][0] = false;
  354. };
  355. } else if (command === "enable_other") {
  356. if ($gameSystem._fastTravelOther[Number(args[1])]) {
  357. $gameSystem._fastTravelOther[Number(args[1])][0] = true;
  358. };
  359. } else if (command === "disable_other") {
  360. if ($gameSystem._fastTravelOther[Number(args[1])]) {
  361. $gameSystem._fastTravelOther[Number(args[1])][0] = false;
  362. };
  363. };
  364. return true;
  365. };
  366.  
  367. //=============================================================================
  368. // ** Game_System
  369. //=============================================================================
  370.  
  371. //==============================
  372. // * Initialize
  373. //==============================
  374. var _mog_fastravel_gsys_initialize = Game_System.prototype.initialize;
  375. Game_System.prototype.initialize = function() {
  376. _mog_fastravel_gsys_initialize.call(this);
  377. this._fastTravelTowns = [];
  378. this._fastTravelDungeons = [];
  379. this._fastTravelOther = [];
  380. this._fastTravelData = null;
  381. this._fastTravelSelection = [-1,""];
  382. this._fastTravelSelected = false;
  383. for (var i = 0; i < Moghunter.fastTravel_Towns.length; i++) {
  384. this._fastTravelTowns[i] = [false,Moghunter.fastTravel_Towns[i],false];
  385. };
  386. for (var i = 0; i < Moghunter.fastTravelDungeons.length; i++) {
  387. this._fastTravelDungeons[i] = [false,Moghunter.fastTravelDungeons[i],false];
  388. };
  389. for (var i = 0; i < Moghunter.fastTravelOther.length; i++) {
  390. this._fastTravelOther[i] = [false,Moghunter.fastTravelOther[i],false];
  391. };
  392. this._fastTravelComp = (Moghunter.fastTravel_Towns.length + Moghunter.fastTravelDungeons.length + Moghunter.fastTravelOther.length) - 3;
  393. };
  394.  
  395. //=============================================================================
  396. // ** Window Travel List
  397. //=============================================================================
  398. function Window_TravelList() {
  399. this.initialize.apply(this, arguments);
  400. };
  401.  
  402. Window_TravelList.prototype = Object.create(Window_Selectable.prototype);
  403. Window_TravelList.prototype.constructor = Window_TravelList;
  404.  
  405. //==============================
  406. // * Initialize
  407. //==============================
  408. Window_TravelList.prototype.initialize = function(x, y, width, height) {
  409. Window_Selectable.prototype.initialize.call(this, x, y, width, height);
  410. this._infoID = 0;
  411. this.activate();
  412. this.select(0);
  413. this.opacity = 0;
  414. this.refresh();
  415. };
  416.  
  417. //==============================
  418. // * data Is Avaliable
  419. //==============================
  420. Window_TravelList.prototype.dataIsAvailable = function(data) {
  421. if (!data) {return false};
  422. if (!data[0] || (data[0] && data[0] === false)) {return false};
  423. if (!data[1]) {return false};
  424. return true;
  425. };
  426.  
  427. //==============================
  428. // * data Is Avaliable
  429. //==============================
  430. Window_TravelList.prototype.setID = function(id) {
  431. this._infoID = id;
  432. this.select(0);
  433. this.refresh();
  434. };
  435.  
  436. //==============================
  437. // * Make Data
  438. //==============================
  439. Window_TravelList.prototype.makeData = function() {
  440. this._data = [];
  441. if (this._infoID === 0) {
  442. var dataInfo = $gameSystem._fastTravelTowns;
  443. } else if (this._infoID === 1) {
  444. var dataInfo = $gameSystem._fastTravelDungeons;
  445. } else {
  446. var dataInfo = $gameSystem._fastTravelOther;
  447. };
  448. for (var i = 0; i < dataInfo.length; i++) {
  449. var data = dataInfo[i + 1];
  450. if (this.dataIsAvailable(data)) {this._data.push(data)};
  451. };
  452. };
  453.  
  454. //==============================
  455. // * MaxCols
  456. //==============================
  457. Window_TravelList.prototype.maxCols = function() {
  458. return 1;
  459. };
  460.  
  461. //==============================
  462. // * MaxItems
  463. //==============================
  464. Window_TravelList.prototype.maxItems = function() {
  465. return this._data ? this._data.length : 1;
  466. };
  467.  
  468. //==============================
  469. // * IsCurrentItemEnabled
  470. //==============================
  471. Window_TravelList.prototype.item = function(i) {
  472. return this._data[i + 1];
  473. };
  474.  
  475. //==============================
  476. // * Refresh
  477. //==============================
  478. Window_TravelList.prototype.refresh = function() {
  479. this.makeData();
  480. this.contents.clear();
  481. this.createContents();
  482. this.contents.fontItalic = true;
  483. this.drawAllItems();
  484. };
  485.  
  486. //==============================
  487. // * DrawItem
  488. //==============================
  489. Window_TravelList.prototype.drawItem = function(i) {
  490. var rect = this.itemRect(i);
  491. rect.width -= this.textPadding();
  492. this.changeTextColor(this.normalColor());
  493. if (!this._data[i][2]) {this.changeTextColor(this.textColor(Moghunter.fastTravelNewColor))}
  494. this.drawText(this._data[i][1].name , rect.x, rect.y,rect.width,"center");
  495. };
  496.  
  497. //==============================
  498. // * Process OK
  499. //==============================
  500. Window_TravelList.prototype.processOk = function() {
  501. if (this._data.length === 0) {return}
  502. $gameSystem._fastTravelSelected = true;
  503. this.deactivate();
  504. this.visible = false;
  505. if (String(Moghunter.fastTravel_fadeBgm) === "true") {AudioManager.fadeOutBgm(2);};
  506. SoundManager.playOk();
  507. this.enableMapColor();
  508. };
  509.  
  510. //==============================
  511. // * enable Map Color
  512. //==============================
  513. Window_TravelList.prototype.enableMapColor = function() {
  514. var dataMap = [];
  515. if (this._infoID === 0) {
  516. var dataInfo = $gameSystem._fastTravelTowns;
  517. } else if (this._infoID === 1) {
  518. var dataInfo = $gameSystem._fastTravelDungeons;
  519. } else {
  520. var dataInfo = $gameSystem._fastTravelOther;
  521. };
  522. for (var i = 0; i < dataInfo.length; i++) {
  523. var data = dataInfo[i];
  524. if (data && data[1]) {
  525. if (data[1].name === this._data[this._index][1].name) {
  526. if (this._infoID === 0) {
  527. $gameSystem._fastTravelTowns[i][2] = true;
  528. } else if (this._infoID === 1) {
  529. $gameSystem._fastTravelDungeons[i][2] = true;
  530. } else {
  531. $gameSystem._fastTravelOther[i][2] = true;
  532. };
  533. };
  534. };
  535. };
  536. };
  537.  
  538. //==============================
  539. // * isOKEnable
  540. //==============================
  541. Window_TravelList.prototype.isOkEnabled = function() {
  542. return true;
  543. };
  544.  
  545. //=============================================================================
  546. // ** Scene Fast Travel
  547. //=============================================================================
  548. function SceneFastTravel() {
  549. this.initialize.apply(this, arguments);
  550. };
  551.  
  552. SceneFastTravel.prototype = Object.create(Scene_Base.prototype);
  553. SceneFastTravel.prototype.constructor = SceneFastTravel;
  554.  
  555. //==============================
  556. // * Initialize
  557. //==============================
  558. SceneFastTravel.prototype.initialize = function() {
  559. Scene_Base.prototype.initialize.call(this);
  560. this._Dataindex = 0;
  561. this._DataindexOld = -1;
  562. this._WidowindexOld = 0;
  563. this._np = [-1,-1];
  564. this._name = "";
  565. this._mapPos = [];
  566. this._needCenter = true;
  567. this._mapMoving = false;
  568. this._currentData = null;
  569. this._fadeTime = Math.min(Math.max(Moghunter.fastTravel_fadeSpeed,1),255);
  570. this._zoomFade = String(Moghunter.fastTravel_zoomAnime) === "true" ? true : false;
  571. this._rotationFade = String(Moghunter.fastTravel_rotationAnime) === "true" ? true : false;
  572. $gameSystem._fastTravelData = null;
  573. $gameSystem._fastTravelSelected = false;
  574. this._phase = 0;
  575. this._mapPos[0] = (Graphics.boxWidth / 2) + Moghunter.fastTravel_CenterX;
  576. this._mapPos[1] = (Graphics.boxHeight / 2) + Moghunter.fastTravel_CenterY;
  577. this._DataTown = this.makeData(0);
  578. this._DataDungeon = this.makeData(1);
  579. this._DataOther = this.makeData(2);
  580. if (String(Moghunter.fastTravel_playBgm) === "true") {this.playBgm()};
  581. };
  582.  
  583. //==============================
  584. // * Play Bgm
  585. //==============================
  586. SceneFastTravel.prototype.playBgm = function() {
  587. BattleManager.saveBgmAndBgs();
  588. var bgm = {};
  589. bgm.name = String(Moghunter.fastTravel_BgmFileName);
  590. bgm.pitch = 100;
  591. bgm.volume = 70;
  592. AudioManager.playBgm(bgm,0);
  593. };
  594.  
  595. //==============================
  596. // * Create
  597. //==============================
  598. SceneFastTravel.prototype.create = function() {
  599. this._field = new Sprite();
  600. this.addChild(this._field);
  601. this.createParallax();
  602. this._Mapfield = new Sprite();
  603. this._field.addChild(this._Mapfield);
  604. this._field.opacity = 0
  605. this.createMap();
  606. this.createStage();
  607. this.createPoints();
  608. this.createCursorNext();
  609. this.createLayout();
  610. this.createListLayout();
  611. this.createListName();
  612. this.createCursor();
  613. this.createWindowList();
  614. this.createCompleted();
  615. if (String(Moghunter.fastTravel_lastIndex) === "true") {
  616. if ($gameSystem._fastTravelSelection[0] >= 0) {this.checkLastSelection()};
  617. };
  618. };
  619.  
  620. //==============================
  621. // * check Last Selection
  622. //==============================
  623. SceneFastTravel.prototype.checkLastSelection = function() {
  624. if ($gameSystem._fastTravelSelection[0] === 0) {
  625. var dataInfo = this._DataTown;
  626. } else if($gameSystem._fastTravelSelection[0] === 1) {
  627. var dataInfo = this._DataDungeon;
  628. } else {
  629. var dataInfo = this._DataOther;
  630. };
  631. var index = -1;
  632. for (var i = 0; i < dataInfo.length; i++) {
  633. var data = dataInfo[i][1];
  634. if (data.name === $gameSystem._fastTravelSelection[1].name) {index = i};
  635. };
  636. if (index >= 0) {
  637. this._Dataindex = $gameSystem._fastTravelSelection[0];
  638. this._windowList.setID(this._Dataindex)
  639. if (index >= this._windowList.maxItems()) {index = 0};
  640. this._windowList.select(index);
  641. this.refreshPointData();
  642. };
  643. };
  644.  
  645. //==============================
  646. // * update Fade In
  647. //==============================
  648. SceneFastTravel.prototype.updateFadeIn = function() {
  649. this._fadeTime--;
  650. if (this._sprite_mcursor) {this._sprite_mcursor.visible = false};
  651. if ($gameSystem._fastTravelSelected) {
  652. if (this._zoomFade && !this._snapShot) {this.createSnapShot()};
  653. if (this._fadeTime <= 0) {this._field.opacity -= 4};
  654. if (this._snapShot) {
  655. this._snapShot.scale.x += 0.005;
  656. this._snapShot.scale.y = this._snapShot.scale.x;
  657. if (this._rotationFade) {this._snapShot.rotation += 0.01};
  658. this._snapShot.opacity = this._field.opacity;
  659. };
  660. if (this._field.opacity <= 0) {
  661. $gameSystem._fastTravelSelected = false;
  662. this.selectMap();
  663. };
  664. } else {
  665. this._field.opacity -= 8;
  666. if (this._field.opacity <= 0) {
  667. SceneManager.pop();
  668. };
  669. };
  670. this._parallax.opacity = this._field.opacity ;
  671. };
  672.  
  673. //==============================
  674. // * Create Snap Shot
  675. //==============================
  676. SceneFastTravel.prototype.createSnapShot = function() {
  677. this._stageprev.visible = false;
  678. this._windowList.deactivate();
  679. this._windowList.visible = false;
  680. this._windowList.update();
  681. this._snapShot = new Sprite();
  682. this._snapShot.bitmap = SceneManager.snap();
  683. this._snapShot.anchor.x = 0.5;
  684. this._snapShot.anchor.y = 0.5;
  685. this._snapShot.x = this._snapShot.bitmap.width / 2;
  686. this._snapShot.y = this._snapShot.bitmap.height / 2;
  687. this.addChild(this._snapShot);
  688. this._field.visible = false;
  689. };
  690.  
  691.  
  692. //==============================
  693. // * update Fade Out
  694. //==============================
  695. SceneFastTravel.prototype.updateFadeOut = function() {
  696. this._field.opacity += 8;
  697. if (this._field.opacity >= 255) {
  698. this._phase = 1;
  699. this._windowList.activate();
  700. }
  701. this._parallax.opacity = this._field.opacity ;
  702. };
  703.  
  704. //==============================
  705. // * set Center Start fidless
  706. //==============================
  707. SceneFastTravel.prototype.setCenterStart = function() {
  708. this._needCenter = false;
  709. this._Mapfield.x = 1280;
  710. this._Mapfield.y = 720;
  711. if (!this._currentData) {
  712. this._np = [this._map.bitmap.width / 2,this._map.bitmap.height / 2];
  713. } else {
  714. this._Mapfield.x = -this._np[0] + this._mapPos[0];
  715. this._Mapfield.y = -this._np[1] + this._mapPos[1];
  716. };
  717. };
  718.  
  719. //==============================
  720. // * Make Data
  721. //==============================
  722. SceneFastTravel.prototype.makeData = function(index) {
  723. var dataMap = [];
  724. if (index === 0) {
  725. var dataInfo = $gameSystem._fastTravelTowns;
  726. } else if (index === 1) {
  727. var dataInfo = $gameSystem._fastTravelDungeons;
  728. } else {
  729. var dataInfo = $gameSystem._fastTravelOther;
  730. };
  731. for (var i = 0; i < dataInfo.length; i++) {
  732. var data = dataInfo[i + 1];
  733. if (this.dataIsAvailable(data)) {dataMap.push(data)};
  734. };
  735. return dataMap;
  736. };
  737.  
  738. //==============================
  739. // * data Is Avaliable
  740. //==============================
  741. SceneFastTravel.prototype.dataIsAvailable = function(data) {
  742. if (!data) {return false};
  743. if (!data[0]) {return false};
  744. if (!data[1]) {return false};
  745. return true;
  746. };
  747.  
  748. //==============================
  749. // * Create Parallax
  750. //==============================
  751. SceneFastTravel.prototype.createParallax = function() {
  752. this._parallax = new TilingSprite(ImageManager.loadfasttravel("Parallax"));
  753. this._parallax.move(0, 0, Graphics.boxWidth, Graphics.boxHeight);
  754. this._field.addChild(this._parallax);
  755. };
  756.  
  757. //==============================
  758. // * Create Map
  759. //==============================
  760. SceneFastTravel.prototype.createMap = function() {
  761. this._map = new Sprite(ImageManager.loadfasttravel("Map"));
  762. this._Mapfield.addChild(this._map);
  763. };
  764.  
  765. //==============================
  766. // * Create Layout
  767. //==============================
  768. SceneFastTravel.prototype.createLayout = function() {
  769. this._layout = new Sprite(ImageManager.loadfasttravel("Layout"));
  770. this._field.addChild(this._layout);
  771. };
  772.  
  773. //==============================
  774. // * Create Stage
  775. //==============================
  776. SceneFastTravel.prototype.createStage = function() {
  777. this._stageprev = new Sprite();
  778. this._stageprev.bitmap = new Bitmap(32,32);
  779. this._stageprev.x = Moghunter.fastTravel_Prev_X;
  780. this._stageprev.y = Moghunter.fastTravel_Prev_Y;
  781. this._stageprev.opacity = 255;
  782. this._stageprev.anchor.x = 0.5;
  783. this._stageprev.anchor.y = 0.5;
  784. this._field.addChild(this._stageprev);
  785. };
  786.  
  787. //==============================
  788. // * refresh Stage
  789. //==============================
  790. SceneFastTravel.prototype.refreshStage = function() {
  791. var name = String(this._currentData.name);
  792. this._stageprev.bitmap = ImageManager.loadfasttravelstages(name);
  793. if (String(Moghunter.fastTravel_prevSlide) === "true") {
  794. this._stageprev.x = Moghunter.fastTravel_Prev_X - 100;
  795. this._stageprev.opacity = 0;
  796. };
  797. };
  798.  
  799. //==============================
  800. // * update Stage
  801. //==============================
  802. SceneFastTravel.prototype.updateStage = function() {
  803. if (this._mapMoving) {return};
  804. if (this._stageprev.x < Moghunter.fastTravel_Prev_X) {
  805. this._stageprev.x += 5;
  806. this._stageprev.opacity += 15;
  807. if (this._stageprev.x >= Moghunter.fastTravel_Prev_X) {
  808. this._stageprev.x = Moghunter.fastTravel_Prev_X;
  809. this._stageprev.opacity = 255;
  810. };
  811. };
  812. this._stageprev.visible = !this._currentData ? false : true;
  813. };
  814.  
  815. //==============================
  816. // * Create Completed
  817. //==============================
  818. SceneFastTravel.prototype.createCompleted = function() {
  819. this._comp = new Sprite(new Bitmap(200,32));
  820. this._comp.x = Moghunter.fastTravel_Comp_X
  821. this._comp.y = Moghunter.fastTravel_Comp_Y
  822. this._comp.bitmap.fontSize = Moghunter.fastTravel_Comp_FontSize;
  823. var ct = this._DataTown.length + this._DataDungeon.length + this._DataOther.length;
  824. var perc = Math.floor(ct / $gameSystem._fastTravelComp * 100)
  825. var total = ct + " / " + $gameSystem._fastTravelComp
  826. this._comp.bitmap.drawText(total + " (" + perc + "%" + ")",0,0,200,32, "center");
  827. this._field.addChild(this._comp);
  828. this._comp.visible = String(Moghunter.fastTravel_Comp_Show) === "true" ? true : false;
  829. };
  830.  
  831. //==============================
  832. // * Create List Name
  833. //==============================
  834. SceneFastTravel.prototype.createListName = function() {
  835. this._listName = [];
  836. this._listName[0] = new Sprite(ImageManager.loadfasttravel("ListName_A"))
  837. this._listName[0].x = Moghunter.fastTravel_ComA_X;
  838. this._listName[0].y = Moghunter.fastTravel_ComA_Y;
  839. this._field.addChild(this._listName[0]);
  840. this._listName[1] = new Sprite(ImageManager.loadfasttravel("ListName_B"))
  841. this._listName[1].x = Moghunter.fastTravel_ComB_X;
  842. this._listName[1].y = Moghunter.fastTravel_ComB_Y;
  843. this._field.addChild(this._listName[1]);
  844. this._listName[2] = new Sprite(ImageManager.loadfasttravel("ListName_C"))
  845. this._listName[2].x = Moghunter.fastTravel_ComC_X;
  846. this._listName[2].y = Moghunter.fastTravel_ComC_Y;
  847. this._field.addChild(this._listName[2]);
  848. };
  849.  
  850. //==============================
  851. // * update List Name
  852. //==============================
  853. SceneFastTravel.prototype.updateListName = function() {
  854. this.slideDown(this._listName[0],0,Moghunter.fastTravel_ComA_Y);
  855. this.slideDown(this._listName[1],1,Moghunter.fastTravel_ComB_Y);
  856. this.slideDown(this._listName[2],2,Moghunter.fastTravel_ComC_Y);
  857. };
  858.  
  859. //==============================
  860. // * update List Name
  861. //==============================
  862. SceneFastTravel.prototype.slideDown = function(sprite,index,y) {
  863. if (this._Dataindex === index) {
  864. if (sprite.y < y + 20) {
  865. sprite.y += 4;
  866. if (sprite.y > y + 20) {sprite.y = y + 20};
  867. };
  868. } else {
  869. if (sprite.y > y) {
  870. sprite.y -= 4;
  871. if (sprite.y < y ) {sprite.y = y};
  872. };
  873. };
  874. };
  875.  
  876. //==============================
  877. // * Create Cursor
  878. //==============================
  879. SceneFastTravel.prototype.createCursor = function() {
  880. this._cursor = new Sprite(ImageManager.loadfasttravel("Cursor_A"));
  881. this._cursor.anchor.x = 0.5;
  882. this._cursorAni = [0,0,0];
  883. this._cursorFloat = String(Moghunter.fastTravel_CursorFloat) === "true" ? true : false;
  884. this._field.addChild(this._cursor);
  885. };
  886.  
  887. //==============================
  888. // * Update Cursor
  889. //==============================
  890. SceneFastTravel.prototype.updateCursor = function() {
  891. if (this._cursorFloat) {this.updateCursorFloat()};
  892. if (this._Dataindex === 0) {
  893. this._cursor.x = this._listName[0].x + (this._listName[0].bitmap.width / 2) + Moghunter.fastTravel_CursorX;
  894. this._cursor.y = this._listName[0].y + this._listName[0].bitmap.height + this._cursorAni[1] + Moghunter.fastTravel_CursorY;
  895. } else if (this._Dataindex === 1) {
  896. this._cursor.x = this._listName[1].x + (this._listName[1].bitmap.width / 2) + Moghunter.fastTravel_CursorX;
  897. this._cursor.y = this._listName[1].y + this._listName[1].bitmap.height + this._cursorAni[1] + Moghunter.fastTravel_CursorY;
  898. } else {
  899. this._cursor.x = this._listName[2].x + (this._listName[2].bitmap.width / 2) + Moghunter.fastTravel_CursorX;
  900. this._cursor.y = this._listName[2].y + this._listName[2].bitmap.height + this._cursorAni[1] + Moghunter.fastTravel_CursorY;
  901. };
  902. };
  903.  
  904. //==============================
  905. // * Update Cursor Float
  906. //==============================
  907. SceneFastTravel.prototype.updateCursorFloat = function() {
  908. this._cursorAni[3] ++;
  909. if (this._cursorAni[3] < 3) {return};
  910. this._cursorAni[3] = 0;
  911. this._cursorAni[0] ++
  912. if (this._cursorAni[0] < 10) {
  913. this._cursorAni[1] --;
  914. } else if (this._cursorAni[0] < 20) {
  915. this._cursorAni[1] ++;
  916. } else {
  917. this._cursorAni[0] = 0;
  918. this._cursorAni[1] = 0;
  919. };
  920. };
  921.  
  922. //==============================
  923. // * Create Cursor Next
  924. //==============================
  925. SceneFastTravel.prototype.createCursorNext = function() {
  926. this._cursorB = new Sprite(ImageManager.loadfasttravel("Cursor_B"));
  927. this._cursorB.anchor.x = 0.5;
  928. this._cursorB.anchor.y = 1.0;
  929. this._cursorBAni = [0,0,0];
  930. this._cursorBFloat = String(Moghunter.fastTravel_CursorBFloat) === "true" ? true : false;
  931. this._Mapfield.addChild(this._cursorB);
  932. };
  933.  
  934. //==============================
  935. // * Update CursorB
  936. //==============================
  937. SceneFastTravel.prototype.updateCursorB = function() {
  938. if (this._cursorBFloat) {this.updateCursorBFloat()};
  939. this._cursorB.x = this._np[0] + Moghunter.fastTravel_CursorBX;
  940. this._cursorB.y = this._np[1] + this._cursorBAni[1] + Moghunter.fastTravel_CursorBY - 10;
  941. this._cursorB.visible = !this._currentData ? false : true;
  942. };
  943.  
  944. //==============================
  945. // * Update Cursor B Float
  946. //==============================
  947. SceneFastTravel.prototype.updateCursorBFloat = function() {
  948. this._cursorBAni[3] ++;
  949. if (this._cursorBAni[3] < 3) {return};
  950. this._cursorBAni[3] = 0;
  951. this._cursorBAni[0] ++
  952. if (this._cursorBAni[0] < 10) {
  953. this._cursorBAni[1] ++;
  954. } else if (this._cursorBAni[0] < 20) {
  955. this._cursorBAni[1] --;
  956. } else {
  957. this._cursorBAni[0] = 0;
  958. this._cursorBAni[1] = 0;
  959. };
  960. };
  961.  
  962. //==============================
  963. // * Create Points
  964. //==============================
  965. SceneFastTravel.prototype.createPoints = function() {
  966. this._pointTown = [];
  967. this._pointDungeon = [];
  968. this._pointOther = [];
  969. this._pointImg = ImageManager.loadfasttravel("Points");
  970. this._pointNeedRefresh = true;
  971. for (var i = 0; i < this._DataTown.length; i++) {
  972. this._pointTown[i] = new Sprite(this._pointImg);
  973. this._pointTown[i].x = this._DataTown[i][1].x;
  974. this._pointTown[i].y = this._DataTown[i][1].y;
  975. this._pointTown[i].anchor.x = 0.5;
  976. this._pointTown[i].anchor.y = 0.5;
  977. this._Mapfield.addChild(this._pointTown[i]);
  978. };
  979. for (var i = 0; i < this._DataDungeon.length; i++) {
  980. this._pointDungeon[i] = new Sprite(this._pointImg);
  981. this._pointDungeon[i].x = this._DataDungeon[i][1].x;
  982. this._pointDungeon[i].y = this._DataDungeon[i][1].y;
  983. this._pointDungeon[i].anchor.x = 0.5;
  984. this._pointDungeon[i].anchor.y = 0.5;
  985. this._Mapfield.addChild(this._pointDungeon[i]);
  986. };
  987. for (var i = 0; i < this._DataOther.length; i++) {
  988. this._pointOther[i] = new Sprite(this._pointImg);
  989. this._pointOther[i].x = this._DataOther[i][1].x;
  990. this._pointOther[i].y = this._DataOther[i][1].y;
  991. this._pointOther[i].anchor.x = 0.5;
  992. this._pointOther[i].anchor.y = 0.5;
  993. this._Mapfield.addChild(this._pointOther[i]);
  994. };
  995. };
  996.  
  997. //==============================
  998. // * refresh Points
  999. //==============================
  1000. SceneFastTravel.prototype.refreshPoint = function() {
  1001. this._pointNeedRefresh = false;
  1002. this.setFramePoint(this._pointTown,0);
  1003. this.setFramePoint(this._pointDungeon,1);
  1004. this.setFramePoint(this._pointOther,2);
  1005. };
  1006.  
  1007. //==============================
  1008. // * set Frame Point
  1009. //==============================
  1010. SceneFastTravel.prototype.setFramePoint = function(sprites,index) {
  1011. var cw = this._pointImg.width / 3;
  1012. var ch = this._pointImg.height;
  1013. var rg = cw * index;
  1014. for (var i = 0; i < sprites.length; i++) {
  1015. sprites[i].setFrame(rg,0,cw,ch);
  1016. };
  1017.  
  1018. };
  1019.  
  1020. //==============================
  1021. // * update Points
  1022. //==============================
  1023. SceneFastTravel.prototype.updatePoints = function() {
  1024. if (this._pointNeedRefresh &&this._pointImg.isReady()) {this.refreshPoint()};
  1025. };
  1026.  
  1027. //==============================
  1028. // * Create List Layout
  1029. //==============================
  1030. SceneFastTravel.prototype.createListLayout = function() {
  1031. this._listLayout = new Sprite(ImageManager.loadfasttravel("ListLayout"));
  1032. this._field.addChild(this._listLayout);
  1033. };
  1034.  
  1035. //==============================
  1036. // * update List Layout
  1037. //==============================
  1038. SceneFastTravel.prototype.updateListLayout = function() {
  1039. this._listLayout.x = this._windowList.x + Moghunter.fastTravel_ListLayoutX;
  1040. this._listLayout.y = this._windowList.y + Moghunter.fastTravel_ListLayoutY;
  1041. this._listLayout.opacity = this._windowList.contentsOpacity;
  1042. this._listLayout.visible = this._windowList.visible;
  1043. };
  1044.  
  1045. //==============================
  1046. // * Create Window List
  1047. //==============================
  1048. SceneFastTravel.prototype.createWindowList = function() {
  1049. var w = Moghunter.fastTravel_ListWidth;
  1050. var h = Moghunter.fastTravel_ListHeight;
  1051. var x = Moghunter.fastTravel_ListX;
  1052. var y = Moghunter.fastTravel_ListY;
  1053. this._windowList = new Window_TravelList(x,y,w,h);
  1054. this._windowList.deactivate();
  1055. if (String(Moghunter.fastTravel_ListSlide) === "true") {
  1056. this._windowList.x = Moghunter.fastTravel_ListX + 100;
  1057. this._windowList.contentsOpacity = 0;
  1058. };
  1059. this._field.addChild(this._windowList);
  1060. this.updateListLayout();
  1061. };
  1062.  
  1063. //==============================
  1064. // * update Window List
  1065. //==============================
  1066. SceneFastTravel.prototype.updateWindowList = function() {
  1067. if (this._windowList.x > Moghunter.fastTravel_ListX) {
  1068. this._windowList.x -= 5;
  1069. this._windowList.contentsOpacity += 15;
  1070. if (this._windowList.x <= Moghunter.fastTravel_ListX) {
  1071. this._windowList.x = Moghunter.fastTravel_ListX;
  1072. this._windowList.contentsOpacity = 255;
  1073. };
  1074. };
  1075. };
  1076.  
  1077. //==============================
  1078. // * Need Refresh Point DAta
  1079. //==============================
  1080. SceneFastTravel.prototype.needRefreshPointData = function() {
  1081. if (this._DataindexOld != this._Dataindex) {return true};
  1082. if (this._WidowindexOld != this._windowList._index) {return true};
  1083. return false;
  1084. };
  1085.  
  1086. //==============================
  1087. // * refresh Point Data
  1088. //==============================
  1089. SceneFastTravel.prototype.refreshPointData = function() {
  1090. this._currentData = null;
  1091. $gameSystem._fastTravelData = null;
  1092. this._DataindexOld = this._Dataindex;
  1093. this._WidowindexOld = this._windowList._index;
  1094. if (this._Dataindex === 0) {
  1095. var data = this._DataTown;
  1096. } else if (this._Dataindex === 1) {
  1097. var data = this._DataDungeon;
  1098. } else {
  1099. var data = this._DataOther;
  1100. };
  1101. if (!data || (data && data.length === 0) || !data[this._WidowindexOld]) {
  1102. return
  1103. };
  1104. this._name = data[this._WidowindexOld][1].name;
  1105. this._currentData = data[this._WidowindexOld][1];
  1106. $gameSystem._fastTravelData = data[this._WidowindexOld][1];
  1107. this._np = [data[this._WidowindexOld][1].x,data[this._WidowindexOld][1].y];
  1108. this.refreshStage();
  1109. };
  1110.  
  1111. //==============================
  1112. // * update Command
  1113. //==============================
  1114. SceneFastTravel.prototype.updateCommand = function() {
  1115. if (Input.isRepeated('left') || Input.isRepeated('pagedown')) {
  1116. this.nextData(-1);
  1117. } else if (Input.isRepeated('right') || Input.isRepeated('pageup')) {
  1118. this.nextData(1);
  1119. } else if (Input.isTriggered('ok')) {
  1120. if (this._currentData) {
  1121. this._windowList.visible = false;
  1122. this._windowList.deactivate();
  1123. $gameSystem._fastTravelSelection = [this._Dataindex,this._currentData];
  1124. } else {
  1125. SoundManager.playBuzzer();
  1126. };
  1127. } else if (Input.isTriggered('cancel') || TouchInput.isCancelled()) {
  1128. this.executeCancel();
  1129. } else if (TouchInput.isTriggered()) {
  1130. this.checkTouchOnListCom()
  1131. };
  1132. };
  1133.  
  1134. //==============================
  1135. // * check Touch On List Com
  1136. //==============================
  1137. SceneFastTravel.prototype.checkTouchOnListCom = function() {
  1138. if (this.isOnSprite(this._listName[0])) {
  1139. this._Dataindex = 0;
  1140. this.nextData(0);
  1141. } else if (this.isOnSprite(this._listName[1])) {
  1142. this._Dataindex = 1;
  1143. this.nextData(0);
  1144. } else if (this.isOnSprite(this._listName[2])) {
  1145. this._Dataindex = 2;
  1146. this.nextData(0);
  1147. };
  1148. };
  1149.  
  1150. //==============================
  1151. // * is On Sprite
  1152. //==============================
  1153. SceneFastTravel.prototype.isOnSprite = function(sprite) {
  1154. var cw = sprite.bitmap.width;
  1155. var ch = sprite.bitmap.height;
  1156. if (TouchInput.x < sprite.x) { return false};
  1157. if (TouchInput.x > sprite.x + cw) { return false};
  1158. if (TouchInput.y < sprite.y) { return false};
  1159. if (TouchInput.y > sprite.y + ch) { return false};
  1160. return true;
  1161. };
  1162.  
  1163. //==============================
  1164. // * Select Stage
  1165. //==============================
  1166. SceneFastTravel.prototype.executeCancel = function() {
  1167. SoundManager.playCancel();
  1168. if (String(Moghunter.fastTravel_playBgm) === "true") {
  1169. AudioManager.stopBgm();
  1170. BattleManager.replayBgmAndBgs();
  1171. };
  1172. this._phase = 2;
  1173. this._windowList.deactivate();
  1174. if (String(Moghunter.fastTravel_directionCancel) === "true") { this.setPlayerDirectionforCancel()};
  1175. };
  1176.  
  1177. //==============================
  1178. // * Set Player Direction for
  1179. //==============================
  1180. SceneFastTravel.prototype.setPlayerDirectionforCancel = function() {
  1181. if ($gamePlayer._direction === 2) {
  1182. $gamePlayer.setDirection(8)
  1183. } else if($gamePlayer._direction === 4) {
  1184. $gamePlayer.setDirection(6)
  1185. } else if($gamePlayer._direction === 6) {
  1186. $gamePlayer.setDirection(4)
  1187. } else {
  1188. $gamePlayer.setDirection(2)
  1189. };
  1190. };
  1191.  
  1192. //==============================
  1193. // * Select Map
  1194. //==============================
  1195. SceneFastTravel.prototype.selectMap = function() {
  1196. if (this._currentData) {
  1197. $gameSystem._fastTravelSelection = [this._Dataindex,this._currentData];
  1198. };
  1199. $gameSystem._fastTravelSelected = false;
  1200. var dir = this.setDirection(this._currentData.direction);
  1201. $gamePlayer.reserveTransfer(this._currentData.mapID, this._currentData.mapX, this._currentData.mapY, dir, false);
  1202. SceneManager.goto(Scene_Map);
  1203. };
  1204.  
  1205. //==============================
  1206. // * set Direction
  1207. //==============================
  1208. SceneFastTravel.prototype.setDirection = function(dir) {
  1209. if (dir === 4 || dir === 6 || dir === 8) {return dir};
  1210. return 2;
  1211. };
  1212.  
  1213. //==============================
  1214. // * next Data
  1215. //==============================
  1216. // fidless change data index 1 to 2 to increase list
  1217. SceneFastTravel.prototype.nextData = function(value) {
  1218. this._Dataindex += value;
  1219. if (this._Dataindex > 1) {this._Dataindex = 0};
  1220. if (this._Dataindex < 0) {this._Dataindex = 1};
  1221. SoundManager.playCursor();
  1222. this._windowList.setID(this._Dataindex);
  1223. if (String(Moghunter.fastTravel_ListSlide) === "true") {
  1224. this._windowList.x = Moghunter.fastTravel_ListX + 100;
  1225. this._windowList.contentsOpacity = 0;
  1226. };
  1227. };
  1228.  
  1229. //==============================
  1230. // * Update Parallax
  1231. //==============================
  1232. SceneFastTravel.prototype.updateParallax = function() {
  1233. this._parallax.origin.x += 1;
  1234. this._parallax.origin.y += 1;
  1235. };
  1236.  
  1237. //==============================
  1238. // * Update Parallax
  1239. //==============================
  1240. SceneFastTravel.prototype.updateMapPosition = function() {
  1241. if (this.needRefreshPointData()) {this.refreshPointData()};
  1242. this._Mapfield.x = this.mapMoveTo(this._Mapfield.x,-this._np[0] + this._mapPos[0]);
  1243. this._Mapfield.y = this.mapMoveTo(this._Mapfield.y,-this._np[1] + this._mapPos[1]);
  1244. if (this._Mapfield.x === (-this._np[0] + this._mapPos[0]) && this._Mapfield.y === (-this._np[1] + this._mapPos[1])) {
  1245. this._mapMoving = false;
  1246. } else {
  1247. this._mapMoving = true;
  1248. };
  1249. };
  1250.  
  1251. //==============================
  1252. // * Map Move To
  1253. //==============================
  1254. SceneFastTravel.prototype.mapMoveTo = function(value,real_value) {
  1255. if (value == real_value) {return value};
  1256. var dnspeed = 3 + (Math.abs(value - real_value) / Moghunter.fastTravel_MapMoveSpeed);
  1257. if (value > real_value) {value -= dnspeed;
  1258. if (value < real_value) {value = real_value};}
  1259. else if (value < real_value) {value += dnspeed;
  1260. if (value > real_value) {value = real_value};
  1261. };
  1262. return Math.floor(value);
  1263. };
  1264.  
  1265. //==============================
  1266. // * Update
  1267. //==============================
  1268. SceneFastTravel.prototype.update = function() {
  1269. Scene_Base.prototype.update.call(this);
  1270. if (this._needCenter) {
  1271. if (this._map.bitmap.isReady()) {this.setCenterStart()};
  1272. return;
  1273. };
  1274. if (this._phase === 1 && !$gameSystem._fastTravelSelected) {this.updateCommand()};
  1275. if (this._phase > 0) {
  1276. this.updateMapPosition();
  1277. this.updateWindowList();
  1278. this.updateListLayout();
  1279. };
  1280. this.updateParallax();
  1281. this.updatePoints();
  1282. this.updateCursor();
  1283. this.updateCursorB();
  1284. this.updateStage();
  1285. this.updateListName();
  1286. if (this._phase === 0) {this.updateFadeOut()
  1287. } else if ((!this._mapMoving && $gameSystem._fastTravelSelected) || this._phase === 2) {this.updateFadeIn()};
  1288. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement