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

Project1

 找回密码
 注册会员
搜索
查看: 8923|回复: 9
打印 上一主题 下一主题

[原创发布] 仿黄金太阳式自动跳跃(手动设置)

[复制链接]

Lv1.梦旅人

Mr.Gandum

梦石
0
星屑
226
在线时间
2070 小时
注册时间
2007-1-31
帖子
3039

贵宾

跳转到指定楼层
1
发表于 2015-10-24 10:21:19 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
本帖最后由 feizhaodan 于 2015-11-18 14:36 编辑

JAVASCRIPT 代码复制下载
  1. //=============================================================================
  2. // Jump Gap
  3. // Jump Gap.js
  4. // Version: 1.01
  5. // Changes: 1.01
  6. //          - Added a detection to prevent jumping into non-movable tile or
  7. //            tile that is occupied by events.
  8. //          - Added Config option to decide SE played when jumping.
  9. //          1.00
  10. //          - First Published.
  11. //=============================================================================
  12.  
  13. var Imported = Imported || {};
  14. Imported.Kien_JumpGap = true;
  15.  
  16. var Kien = Kien || {};
  17. Kien.JumpGap = {};
  18.  
  19.  
  20. //=============================================================================
  21. /*:
  22.  * @plugindesc Add the feature of auto jumping through gaps
  23.  * @author Kien
  24.  
  25.  * @param SE Name
  26.  * @desc Name of SE played when jumping. Left Empty to not play SE.
  27.  * @default
  28.  
  29.  * @param SE Volume
  30.  * @desc Volume of SE.
  31.  * @default 90
  32.  
  33.  * @param SE Pitch
  34.  * @desc Pitch of SE.
  35.  * @default 100
  36.  
  37.  * @param SE Pan
  38.  * @desc Pan of SE.
  39.  * @default 100
  40.  
  41.  * @help
  42.  * ============================================================================
  43.  * * Jump Gap (English Document)
  44.  * ============================================================================
  45.  * Add a easy way to perform jumping at 1 tile space gaps, similar to the game Golden Sun Series.
  46.  * ============================================================================
  47.  * * How to Use
  48.  * ============================================================================
  49.  * Add following notes to the maps you want this feature enables:
  50.  * <Jump Region *rid,*dir>
  51.  * This will set region ID *id as marker of a jump action, allowing to jump to *dir directions.
  52.  * For example:
  53.  * <Jump Region 63,2468> will set region 63 as a marker to allow player jump from all direction, and
  54.  * <Jump Region 62,2> will set region 62 as a marker to allow player jump from up to down.
  55.  * allowed directions are 2=down, 4=left, 6=right and 8=up.
  56.  * The marker is use to mark the map tile that is not passable normally, and at 1 tile further there have a passable tile.
  57.  * ============================================================================
  58.  * * End of Document (English Document)
  59.  * ============================================================================
  60.  * ============================================================================
  61.  * * 自動ジャンプ(Japanese Document)
  62.  * ============================================================================
  63.  * 黄金の太陽シリーズに似たコントロール可能な自動ジャンプ機能を追加します。
  64.  * ============================================================================
  65.  * * 使い方
  66.  * ============================================================================
  67.  * 次のような内容を適用したいマップのメモ欄に追加します:
  68.  * <Jump Region *rid,*dir>
  69.  * これはrid番のリージョンIDを、*dir方向に向かってジャンプできるように設定するマーカーとして機能させます
  70.  * 例として、<Jump Region 63,2468>はリージョンID63が設定された通行不能タイルをすべての方向に向かってジャンプ可能なタイルとして設定し、
  71.  * <Jump Region 62,2>はリージョンID62が設定された通行不能タイルを下方向に向かってジャンプ可能なタイルとして設定します。
  72.  * 方向として指定可能な数字は2=下方向、4=左方向、6=右方向、8=上方向です。
  73.  * 通行不能タイルに指定したリージョンIDを設定し、さらにジャンプ方向に通行可能タイルが存在する場合にのみジャンプします
  74.  * ============================================================================
  75.  * * ドキュメント終了 (Japanese Document)
  76.  * ============================================================================
  77.  * ============================================================================
  78.  * * 自动跳跃(Chinese Document)
  79.  * ============================================================================
  80.  * 添加类似黄金太阳系列的自动跳跃功能。需要用户自己设置可跳跃区域
  81.  * ============================================================================
  82.  * * 用法
  83.  * ============================================================================
  84.  * 添加以下内容到地图的备注栏
  85.  * <Jump Region *rid,*dir>
  86.  * 这将把rid号区域ID设置为可以向dir方向跳跃的标记。
  87.  * 比如说,<Jump Region 63,2468>会将区域63设置为允许向全方向跳跃的标记,
  88.  * <Jump Region 62,2>会将区域62设置为允许向下方跳跃的标记。
  89.  * 可以设置的方向为2=下方,4=左方,6=右方,8=上方。
  90.  * 标记不可通行的图块。当不可通行图块的前方(玩家移动的方向&你设置的方向)有可通行图块时执行跳跃。
  91.  * ============================================================================
  92.  * * 文档结束 (Chinese Document)
  93.  * ============================================================================
  94. */
  95.  
  96. Kien.JumpGap.parameters = PluginManager.parameters("JumpGap");
  97. Kien.JumpGap.SE = { name:   Kien.JumpGap.parameters["SE Name"],
  98.                     pitch:  Kien.JumpGap.parameters["SE Pitch"],
  99.                     volume: Kien.JumpGap.parameters["SE Volume"],
  100.                     pan:    Kien.JumpGap.parameters["SE Pan"]}
  101.  
  102. Kien.JumpGap.Game_Player_moveStraight = Game_Player.prototype.moveStraight;
  103. Game_Player.prototype.moveStraight = function (d) {
  104.     Kien.JumpGap.Game_Player_moveStraight.call(this, d);
  105.     if (!this.isMovementSucceeded() && !$gameMap.isEventRunning()) {
  106.         var x2 = $gameMap.roundXWithDirection(this._x, d);
  107.         var y2 = $gameMap.roundYWithDirection(this._y, d);
  108.         var rid = $gameMap.regionId(x2, y2);
  109.         if ($gameMap.jumpDirFromRegion(rid).contains(d)) {
  110.             var x3 = $gameMap.roundXWithDirection(x2, d);
  111.             var y3 = $gameMap.roundYWithDirection(y2, d);
  112.             if (this.canPassByJump(x3,y3)){
  113.                 this.jump(x3 - this._x,y3  - this._y);
  114.                 if (!Kien.JumpGap.SE.name.length == 0){
  115.                     AudioManager.playSe(Kien.JumpGap.SE);
  116.                 }
  117.             }
  118.         }
  119.     }
  120. };
  121.  
  122. Game_Player.prototype.canPassByJump = function(x, y) {
  123.     if (!$gameMap.isValid(x, y)) {
  124.         return false;
  125.     }
  126.     if (this.isThrough() || this.isDebugThrough()) {
  127.         return true;
  128.     }
  129.     if ([2,4,6,8].filter(function(d){return $gameMap.isPassable(x, y, d)}).length == 0){
  130.         return false;
  131.     }
  132.     if (this.isCollidedWithCharacters(x,y)) {
  133.         return false;
  134.     }
  135.     return true;
  136. };
  137.  
  138. Game_Map.prototype.jumpDirFromRegion = function (rid) {
  139.         var reg = RegExp('\<Jump Region '+rid+',([2468]+)\>',"i")
  140.         if ($dataMap.note.match(reg)!= null){
  141.                 return (RegExp.$1.toString().split("").map(function(v) {return parseInt(v) } ));
  142.         }
  143.     return [];
  144. }

放到mv工程的js/plugins/内,并在Plugin Manager里添加插件即可使用。具体设置方法见help内
2015/11/18: 更新,现在自动判断着地点是否可以通行,并可以自动播放SE

评分

参与人数 1星屑 +66 梦石 +2 收起 理由
余烬之中 + 66 + 2 入图书馆追加

查看全部评分

Lv2.观梦者

梦石
0
星屑
258
在线时间
1574 小时
注册时间
2010-6-17
帖子
2892

开拓者贵宾

2
发表于 2015-10-24 10:24:34 | 只看该作者
你写的?

点评

原文肯定是英语+日语。  发表于 2015-10-24 15:51
同时在其他地方发布要改三次?我不想  发表于 2015-10-24 14:08
为啥是中文和英文注释?还有霓虹国语言  发表于 2015-10-24 14:02
不然还有谁  发表于 2015-10-24 10:42
回复 支持 反对

使用道具 举报

Lv1.梦旅人 (暗夜天使)

永夜蟄居の玖瀨

梦石
0
星屑
71
在线时间
1018 小时
注册时间
2011-9-5
帖子
2813

开拓者贵宾

3
发表于 2015-10-24 10:41:51 | 只看该作者
居然发到水区
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
1232
在线时间
1017 小时
注册时间
2011-4-30
帖子
1516
4
发表于 2015-10-24 10:42:16 | 只看该作者
求讲讲脚本的格式.....
回复 支持 反对

使用道具 举报

Lv5.捕梦者

梦石
0
星屑
33163
在线时间
10488 小时
注册时间
2009-3-15
帖子
4756
5
发表于 2015-10-24 11:41:07 | 只看该作者
本帖最后由 soulsaga 于 2015-10-24 15:30 编辑

又中英文又日文..
回复 支持 反对

使用道具 举报

Lv2.观梦者

会吐槽的画师

梦石
0
星屑
782
在线时间
3431 小时
注册时间
2011-6-10
帖子
6535
6
发表于 2015-10-24 14:55:33 | 只看该作者
soulsaga 发表于 2015-10-24 11:41
又中英文又日文..
为什么注译不用中文写..

估计是哪里搬来的吧

点评

噗噗哈哈哈wwww  发表于 2015-10-24 15:59
长名公主玩家群:372588926 攻略娱乐应有尽有
了解更多新RM游戏,游戏制作请加入RPGmaker支援群:113622890
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
211
在线时间
905 小时
注册时间
2010-9-6
帖子
3229
7
发表于 2015-10-24 15:49:37 | 只看该作者
这样的脚本目前也只能放在水区炫耀了,有多少人用上MV了呢?反正偶是不用……LZ就当观众都是来吐槽的,请无视。
回复 支持 反对

使用道具 举报

Lv1.梦旅人

路人党员

梦石
0
星屑
51
在线时间
2276 小时
注册时间
2010-12-30
帖子
3225
8
发表于 2015-10-24 16:13:48 | 只看该作者
JAVASCRIPT 代码复制
  1. //=============================================================================
  2. // Fonts.js
  3. //=============================================================================
  4.  
  5. /*:
  6.  * @plugindesc Manage Game Fonts
  7.  * @author 0nepeop1e
  8.  *
  9.  * @param Bitmap Font
  10.  * @desc Default font face used for bitmap in game.
  11.  * @default GameFont
  12.  *
  13.  * @param Window Font
  14.  * @desc Default font face used for window in game.
  15.  * @default GameFont
  16.  *
  17.  * @param Fonts
  18.  * @desc List of @font-face definded in gamefont.css, seperate with ';', the game will wait until the fonts loaded before start
  19.  * @default GameFont
  20.  */
  21.  
  22. Function.prototype.clone = function() {
  23.     var that = this;
  24.     var temp = function () { return that.apply(this, arguments); };
  25.     for(var key in this) {
  26.         if (this.hasOwnProperty(key)) {
  27.             temp[key] = this[key];
  28.         }
  29.     }
  30.     return temp;
  31. };
  32.  
  33. (function(pm){
  34.         ft = {};
  35.  
  36.         ft.bitmapFont = pm.parameters('Fonts')["Bitmap Font"] || "GameFont";
  37.         ft.windowFont = pm.parameters('Fonts')["Window Font"] || "GameFont";
  38.         ft.fontsList = (pm.parameters('Fonts')["Fonts"] || "GameFont").split(";");
  39.  
  40.         Scene_Boot.prototype.isGameFontLoaded = function() {
  41.                 var loaded = Graphics.isFontLoaded(ft.fontsList[0]);
  42.                 for(var i = 1; i < ft.fontsList.length; i++)
  43.                         loaded = loaded && Graphics.isFontLoaded(ft.fontsList[i]);
  44.                 if (loaded) {
  45.                         return true;
  46.                 } else {
  47.                         var elapsed = Date.now() - this._startDate;
  48.                         if (elapsed >= (20000 * ft.fontsList.length)) {
  49.                                 throw new Error('Failed to load Fonts');
  50.                         }
  51.                 }
  52.         };
  53.  
  54.         ft._initBitmap = Bitmap.prototype.initialize.clone();
  55.  
  56.         Bitmap.prototype.initialize = function(){
  57.                 ft._initBitmap.apply(this, arguments);
  58.                 this.fontFace = ft.bitmapFont;
  59.         };
  60.  
  61.         Window_Base.prototype.standardFontFace = function() {
  62.                 return ft.windowFont;
  63.         };
  64.  
  65. })(PluginManager);

刚刚写了个字体插件
本人擅长XP,如果有脚本或者Ruby方面的问题欢迎发电邮到[email protected]咨询,本人很少检查电邮所以不一定会及时回复,本人不会直接出手解决问题只会提供一个方向,所以谢绝伸手党
回复 支持 反对

使用道具 举报

Lv3.寻梦者

Assassin-K

梦石
0
星屑
3463
在线时间
2281 小时
注册时间
2012-5-23
帖子
4065

贵宾

9
发表于 2015-10-24 17:38:03 | 只看该作者
唷,又一猿诈尸,都回来就好了~
新老程猿来得差不多,MV就该要开版了。

◆ROZONE◆
>洛子又要去流浪地球了……
>如果你看到我在线,又没动静,那只能说明我在挂机……
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
420
在线时间
26 小时
注册时间
2017-9-29
帖子
15
10
发表于 2020-11-18 11:37:01 | 只看该作者
感谢感谢。
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-4-23 17:40

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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