设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 4107|回复: 6

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

[复制链接]

Lv3.寻梦者

梦石
0
星屑
1759
在线时间
2524 小时
注册时间
2010-10-12
帖子
1454

开拓者

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

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

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

x
JAVASCRIPT 代码复制下载
  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.  
  14. var MBBS_MV = MBBS_MV || {};
  15. MBBS_MV.ElasticallyScroll = MBBS_MV.MBBS_ElasticallyScroll || {};
  16.  
  17. //=============================================================================
  18. // Game_Player
  19. //=============================================================================
  20. Game_Player.prototype.updateScroll = function(lastScrolledX, lastScrolledY) {
  21.     var x1 = lastScrolledX;
  22.     var y1 = lastScrolledY;
  23.     var x2 = this.scrolledX();
  24.     var y2 = this.scrolledY();
  25.  
  26.     var halfTileWidth   = $gameMap.tileWidth()/2.0;
  27.     var halfTileHeight   = $gameMap.tileHeight()/2.0;
  28.  
  29.     var yGrid = this.centerY()*2;
  30.     var xGrid = this.centerX()*2;
  31.  
  32.     if (y2 > this.centerY()){
  33.       $gameMap.scrollDown(this._realY > $gameMap.height() - this.centerY() ?
  34.         ($gameMap.height() - yGrid - $gameMap.displayY())/halfTileHeight :
  35.         ((y2 - yGrid + this.centerY())/halfTileHeight))
  36.     }
  37.     if (x2 < this.centerX() ){
  38.       $gameMap.scrollLeft(this._realX < this.centerX() ? $gameMap.displayX()/halfTileWidth :
  39.         (($gameMap.displayX() + this.centerX() - this._realX)/halfTileWidth))
  40.     }
  41.     if (x2 > xGrid - this.centerX() ){
  42.       $gameMap.scrollRight(this._realX > $gameMap.width - this.centerX()  ?
  43.         (($gameMap.width - xGrid) - $gameMap.displayX())/halfTileWidth :
  44.         (x2 - xGrid + this.centerX() )/halfTileWidth)
  45.     }
  46.     if (y2 < this.centerY()){
  47.         $gameMap.scrollUp(this._realY < this.centerY() ?  $gameMap.displayY()/halfTileHeight :
  48.       (($gameMap.displayY()+this.centerY()-this._realY)/halfTileHeight))
  49.     }
  50.  
  51. };
  52.  
  53.  
  54. if (Imported.MBBS_MV) {
  55.     Game_EFS_Hero.prototype.updateScroll = function(lastScrolledX, lastScrolledY) {
  56.       var x1 = lastScrolledX;
  57.       var y1 = lastScrolledY;
  58.       var x2 = this.scrolledX();
  59.       var y2 = this.scrolledY();
  60.  
  61.       var halfTileWidth   = $gameMap.tileWidth()/2.0;
  62.       var halfTileHeight   = $gameMap.tileHeight()/2.0;
  63.  
  64.       var yGrid = this.centerY()*2;
  65.       var xGrid = this.centerX()*2;
  66.  
  67.       if (y2 > this.centerY()){
  68.         $gameMap.scrollDown(this._realY > $gameMap.height() - this.centerY() ?
  69.           ($gameMap.height() - yGrid - $gameMap.displayY())/halfTileHeight :
  70.           ((y2 - yGrid + this.centerY())/halfTileHeight))
  71.       }
  72.       if (x2 < this.centerX() ){
  73.         $gameMap.scrollLeft(this._realX < this.centerX() ? $gameMap.displayX()/halfTileWidth :
  74.           (($gameMap.displayX() + this.centerX() - this._realX)/halfTileWidth))
  75.       }
  76.       if (x2 > xGrid - this.centerX() ){
  77.         $gameMap.scrollRight(this._realX > $gameMap.width - this.centerX()  ?
  78.           (($gameMap.width - xGrid) - $gameMap.displayX())/halfTileWidth :
  79.           (x2 - xGrid + this.centerX() )/halfTileWidth)
  80.       }
  81.       if (y2 < this.centerY()){
  82.           $gameMap.scrollUp(this._realY < this.centerY() ?  $gameMap.displayY()/halfTileHeight :
  83.         (($gameMap.displayY()+this.centerY()-this._realY)/halfTileHeight))
  84.       }
  85.  
  86.   };
  87. }
  88.  
  89.  
  90. //=============================================================================
  91. // End of File
  92. //=============================================================================




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

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

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


评分

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

查看全部评分


Lv2.观梦者

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

使用道具 举报

Lv3.寻梦者

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

使用道具 举报

Lv1.梦旅人

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

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
1293
在线时间
995 小时
注册时间
2014-12-14
帖子
3016

开拓者

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

  群战MV要表加点剧情呢?



  

点评

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

使用道具 举报

Lv2.观梦者

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

使用道具 举报

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

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-3-29 07:21

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表