扫描二维码关注官方公众号
返回列表
+ 发新帖
查看: 94|回复: 0

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

[复制链接]
累计送礼:
0 个
累计收礼:
0 个
  • TA的每日心情
    开心
    2025-2-4 02:05
  • 签到天数: 110 天

    连续签到: 2 天

    [LV.6]常住居民II

    2327

    主题

    395

    回帖

    1万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    VIP
    6
    卡币
    10465
    OK点
    16
    推广点
    0
    同能卷
    0
    积分
    13215

    灌水之王

    发表于 2024-11-21 23:13:16 | 显示全部楼层 |阅读模式
    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. 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. //=============================================================================
    复制代码




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

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

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



                本帖来自P1论坛作者刺夜之枪,因Project1站服务器在国外有时候访问缓慢不方便作者交流学习,经联系P1站长fux2同意署名转载一起分享游戏制作经验,共同为国内独立游戏作者共同创造良好交流环境,原文地址:https://rpg.blue/forum.php?mod=viewthread&tid=395907  若有侵权,发帖作者可联系底部站长QQ在线咨询功能删除,谢谢。
    天天去同能,天天有童年!
    回复 送礼论坛版权

    使用道具 举报

    文明发言,和谐互动
    文明发言,和谐互动
    高级模式
    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    关闭

    幸运抽奖

    社区每日抽奖来袭,快来试试你是欧皇还是非酋~

    立即查看

    聊天机器人
    Loading...

    QQ|Archiver|手机版|小黑屋|同能RPG制作大师 ( 沪ICP备12027754号-3 )

    GMT+8, 2025-3-10 11:55 , Processed in 0.092086 second(s), 57 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

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