查看: 5152|回复: 6

[原创发布] 【鸡肋Mini插件】弹性镜头移动

[复制链接]
梦石
0
星屑
1821
在线时间
2528 小时
注册时间
2010-10-12
回帖
1336

开拓者

发表于 2016-8-31 13:27:46 | 显示全部楼层 |阅读模式

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

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

×
  1. //=============================================================================
  2. // Mount Blade Battle System Engine Plugins - Elastically Scroll
  3. // MBBS_ElasticallyScroll.js
  4. //=============================================================================
  5. /*:
  6. * @plugindesc v1.0 MBBS Plugins:
  7.     群战系统MV插件系列之 - 弹性镜头移动 【XP移植】
  8.     MBBS_ElasticallyScroll
  9. * @author Chivalry Studio Plugins / Ivan
  10. */
  11. var Imported = Imported || {};
  12. Imported.MBBS_ElasticallyScroll = true;

  13. var MBBS_MV = MBBS_MV || {};
  14. MBBS_MV.ElasticallyScroll = MBBS_MV.MBBS_ElasticallyScroll || {};

  15. //=============================================================================
  16. // Game_Player
  17. //=============================================================================
  18. Game_Player.prototype.updateScroll = function(lastScrolledX, lastScrolledY) {
  19.     var x1 = lastScrolledX;
  20.     var y1 = lastScrolledY;
  21.     var x2 = this.scrolledX();
  22.     var y2 = this.scrolledY();

  23.     var halfTileWidth   = $gameMap.tileWidth()/2.0;
  24.     var halfTileHeight   = $gameMap.tileHeight()/2.0;

  25.     var yGrid = this.centerY()*2;
  26.     var xGrid = this.centerX()*2;

  27.     if (y2 > this.centerY()){
  28.       $gameMap.scrollDown(this._realY > $gameMap.height() - this.centerY() ?
  29.         ($gameMap.height() - yGrid - $gameMap.displayY())/halfTileHeight :
  30.         ((y2 - yGrid + this.centerY())/halfTileHeight))
  31.     }
  32.     if (x2 < this.centerX() ){
  33.       $gameMap.scrollLeft(this._realX < this.centerX() ? $gameMap.displayX()/halfTileWidth :
  34.         (($gameMap.displayX() + this.centerX() - this._realX)/halfTileWidth))
  35.     }
  36.     if (x2 > xGrid - this.centerX() ){
  37.       $gameMap.scrollRight(this._realX > $gameMap.width - this.centerX()  ?
  38.         (($gameMap.width - xGrid) - $gameMap.displayX())/halfTileWidth :
  39.         (x2 - xGrid + this.centerX() )/halfTileWidth)
  40.     }
  41.     if (y2 < this.centerY()){
  42.         $gameMap.scrollUp(this._realY < this.centerY() ?  $gameMap.displayY()/halfTileHeight :
  43.       (($gameMap.displayY()+this.centerY()-this._realY)/halfTileHeight))
  44.     }

  45. };


  46. if (Imported.MBBS_MV) {
  47.     Game_EFS_Hero.prototype.updateScroll = function(lastScrolledX, lastScrolledY) {
  48.       var x1 = lastScrolledX;
  49.       var y1 = lastScrolledY;
  50.       var x2 = this.scrolledX();
  51.       var y2 = this.scrolledY();

  52.       var halfTileWidth   = $gameMap.tileWidth()/2.0;
  53.       var halfTileHeight   = $gameMap.tileHeight()/2.0;

  54.       var yGrid = this.centerY()*2;
  55.       var xGrid = this.centerX()*2;

  56.       if (y2 > this.centerY()){
  57.         $gameMap.scrollDown(this._realY > $gameMap.height() - this.centerY() ?
  58.           ($gameMap.height() - yGrid - $gameMap.displayY())/halfTileHeight :
  59.           ((y2 - yGrid + this.centerY())/halfTileHeight))
  60.       }
  61.       if (x2 < this.centerX() ){
  62.         $gameMap.scrollLeft(this._realX < this.centerX() ? $gameMap.displayX()/halfTileWidth :
  63.           (($gameMap.displayX() + this.centerX() - this._realX)/halfTileWidth))
  64.       }
  65.       if (x2 > xGrid - this.centerX() ){
  66.         $gameMap.scrollRight(this._realX > $gameMap.width - this.centerX()  ?
  67.           (($gameMap.width - xGrid) - $gameMap.displayX())/halfTileWidth :
  68.           (x2 - xGrid + this.centerX() )/halfTileWidth)
  69.       }
  70.       if (y2 < this.centerY()){
  71.           $gameMap.scrollUp(this._realY < this.centerY() ?  $gameMap.displayY()/halfTileHeight :
  72.         (($gameMap.displayY()+this.centerY()-this._realY)/halfTileHeight))
  73.       }

  74.   };
  75. }


  76. //=============================================================================
  77. // End of File
  78. //=============================================================================
复制代码




这个插件本来是群战核心系统的一部分,我今天顺手给他拆了出来,=。=

具体功能很鸡肋,就是让主角移动的时候镜头有弹性地滚动。试试看就知道了

可以配合群战核心系统使用(然而并没有发布)


评分

参与人数 1星屑 +32 收起 理由
Vortur + 32 后排怒塞!

查看全部评分


梦石
0
星屑
303
在线时间
70 小时
注册时间
2016-8-29
回帖
19
发表于 2016-9-1 23:01:43 | 显示全部楼层
谢谢,已经收藏
回复

使用道具 举报

梦石
0
星屑
1232
在线时间
1017 小时
注册时间
2011-4-30
回帖
1464
发表于 2016-9-2 18:00:49 来自手机 | 显示全部楼层
坐等群战
回复

使用道具 举报

梦石
0
星屑
50
在线时间
15 小时
注册时间
2013-6-1
回帖
3
发表于 2016-9-27 23:33:29 | 显示全部楼层
坐等群战++1
回复

使用道具 举报

梦石
0
星屑
1297
在线时间
995 小时
注册时间
2014-12-14
回帖
2939

开拓者

发表于 2016-9-28 06:51:43 | 显示全部楼层
没糖了,手+45!

  群战MV要表加点剧情呢?



  

点评

加吧  发表于 2016-9-28 12:13
【RMVA教程】
---------------------
欲买桂花同载酒,终不似,少年游.
回复

使用道具 举报

梦石
0
星屑
403
在线时间
37 小时
注册时间
2012-9-14
回帖
7
发表于 2018-11-13 00:50:04 | 显示全部楼层
奇怪.使用插件后    当角色行走时   地图内的一些NPC会有抖动还为啥....等到角色停止不动      镜头不动了才会慢慢恢复
回复 1 0

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部