| 赞 | 4 |
| VIP | |
| 好人卡 | |
| 积分 | 11 |
| 经验 | |
| 最后登录 | 2026-2-7 |
| 在线时间 | 200 小时 |
- 梦石
- 0
- 星屑
- 1121
- 在线时间
- 200 小时
- 注册时间
- 2020-9-28
- 回帖
- 43
|
悬赏10星屑已解决
我用了,发生了错误?有谁知道怎么使用的?
require c. 1 Window getpenis not a fur ction
- //=============================================================================
- // Mano_ChestList.js
- // ----------------------------------------------------------------------------
- // Copyright (c) 2017-2017 Sigureya
- // This software is released under the MIT License.
- // [url]http://opensource.org/licenses/mit-license.php[/url]
- // ----------------------------------------------------------------------------
- // [Twitter]: [url]https://twitter.com/Sigureya/[/url]
- // [github]:[url]https://github.com/Sigureya/RPGmakerMV[/url]
- //=============================================================================
- /*:
- * @plugindesc 查一下当前地图,宝箱的信息
- *
- * @param balloonId
- * @desc chestFlash()中使用的,引出序号的编号。
- * @type select
- * @option 惊吓
- * @value 1
- * @option 感動
- * @value 2
- * @option 音符
- * @value 3
- * @option 红心
- * @value 4
- * @option 怒り
- * @value 5
- * @option 汗
- * @value 6
- * @option 心情不舒畅
- * @value 7
- * @option 沈黙
- * @value 8
- * @option 電球
- * @value 9
- * @option Zzz
- * @value 10
- * @option ユーザー定義1
- * @value 11
- * @option ユーザー定義2
- * @value 12
- * @option ユーザー定義3
- * @value 13
- * @option ユーザー定義4
- * @value 14
- * @option ユーザー定義5
- * @value 15
- * @default 1
- *
- * @param flashSound
- * @type file
- * @dir audio/se
- * @default Flash1
- *
- * @param flashWait
- * @desc 插件命令「ChestFlash」在时,设置是否为开启
- * @type boolean
- * @default true
- *
- * @param CountChest
- * @desc 决定是否使用,简易版盗贼的鼻子
- * 面向写活动命令,很麻烦的人
- * @type boolean
- * @default false
- *
- * @param CountChestText
- * @desc 这是简易版,盗贼鼻子的,已找到宝物信息。
- * @default 这一带好像,还有%1个宝物。
- * @parent CountChest
- *
- * @param CountChestEmptyText
- * @desc 用简易版盗贼的鼻子
- * 未找到宝物时的消息
- * @default 这一带的宝物,好像都得到了。
- * @parent CountChest
- *
- *
- *
- * @author しぐれん(魔のささやき)
- * @help
- * 在想当做宝箱的活动的,笔记栏里<宝箱>或者<chest>请写下来。
- * 是否打开取决于事件页面,是否是最大的页面。
- * 没有图形也可以做成宝箱。
- *
- * 通过在变量的操作(脚本)中,写入以下内容来获取数据。
- *
- * $gameMap.countChest()
- * 所有宝箱的数量
- * $gameMap.countOpendChest()
- * 打开的宝箱数量
- * $gameMap.countClosedChest()
- * 未打开的宝箱数量
- *
- * 以下是可以通过,事件命令“脚本”执行的内容。
- * $gameMap.chestFlash()
- * 在画面内的宝箱中,让所有没有打开的东西发光。
- * 虽然是发光方式,但是通过气球的再生来进行。
- *
- * 插件命令
- *「ChestFlash」因此,没有打开的宝箱,会带有气球
- *
- */
- /*~struct~CommonDefine:
- *
- * @param enableSwitch
- * @desc 指定したスイッチがONの時だけ、呼びだしを行います。
- * ゲームの進行で機能が追加される場合を想定しています。
- * @type switch
- *
- * @param symbol
- * @desc Input.isTriggered()の引数として使われます
- *
- * @param text
- * @desc コマンド名称です
- *
- * @param mandatory
- * @desc inputConfigの方で必須指定されたものとして扱います。
- * @type boolean
- * @default false
- *
- * @param keycode
- * @desc キーボードの割り当てです
- * キーコードは各自調べてください
- * @type number
- *
- * @param padButton
- * @desc ゲームパッドの割り当てです
- * カッコ内はツクールのデフォルトでの割り当てです
- * @type select
- * @default -1
- * @option non(割り当てなし)
- * @value -1
- * @type select
- * @option button6
- * @value 6
- * @option button7
- * @value 7
- * @option button8
- * @value 8
- * @option button9
- * @value 9
- * @option button10
- * @value 10
- * @option button11
- * @value 11
- * @option button0(ok/決定)
- * @value 0
- * @option button1(cancel/キャンセル)
- * @value 1
- * @option button2(shift/ダッシュ)
- * @value 2
- * @option button3(menu/メニュー)
- * @value 3
- * @option button4(pageup)
- * @value 4
- * @option button5(pagedown)
- * @value 5
- */
- /**
- * TODO
- * isChestで、宝箱であるかどうかをチェック
- * レミラーマは、該当するイベントに対してのアニメーション再生で
- *
- * 指定要素をカウントする関数で、盗賊の鼻
- * タグを切り替えることで、話しかけた重要人物リスト
- *
- * ■countSelfSwitch(マップID)について
- * 他のマップを調べられるレミラーマです。
- * マップに親子関係がある場合、このマップを再起的に調べます。
- * この関数を使う場合、全てのマップで宝箱に使うセルフスイッチが同じ番号である必要があります。
- * 宝箱以外で指定したセルフスイッチを使うと、正常に動作しません。
- * イベントの簡単作成で宝箱を作成すると、Aが割り当てられるため、Aにすることをお勧めします。
- * 第2引数に'B','C','D'など任意のセルフスイッチに割り当てられるキーを指定することで、
- * 他のセルフスイッチも調べられます。
- *
- * @param oneButtonCountChestCall
- * @desc キーボードやゲームパッドから1ボタンで盗賊の鼻を起動します。
- * @type boolean
- * @on 機能を使う
- * @off 機能を使わない
- * @default false
- *
- */
- (function(){
- 'use strict'
- function createCommonDefine(param){
- const obj =JSON.parse(param);
- return{
- mandatory:Boolean(obj.mandatory),
- text:String(obj.text),
- symbol:String(obj.symbol),
- enableSwitch:Number(obj.enableSwitch),
- keycode:String(obj.keycode),
- padButton:String(obj.padButton),
- };
- }
- function createCountChestSetting(params){
- if(params.CountChest!=='true'){
- return null;
- }
- return {
- countChestEmptyText:String(params.CountChestEmptyText),
- inputDefine :createCommonDefine(params.CountChestinputSetting),
- };
- }
- const setting=(function(){
- const params = PluginManager.parameters('Mano_ChestList');
- const result ={
- chestTag:'chest',
- chestTagJP:'宝箱',
- balloonId:Number(params.balloonId),
- flashSound:{
- name:String(params.flashSound),
- pan:0,
- pitch:100,
- volume:90,
- },
- flashWait:(params.flashWait==='true'),
- countChestText:String(params.CountChestText),
- countChestEmptyText:String(params.CountChestEmptyText),
- countChest:createCountChestSetting(params),
- };
- return result;
- })();
- //const setting =createSetting();
- const KEYSYMBOL_CHESTCOUNT ='ChestCount';
- /**
- * @param {[]} array
- * @param {Function } func
- */
- function countIf(array,func){
- var count =0;
- const len =array.length;
- for (var index = 0; index < len; index++) {
- var elem =array[index];
- if(elem&& func( elem )){
- ++count;
- }
- }
- return count;
- }
- Game_Event.prototype.isChest=function(){
- const meta =this.event().meta;
- return meta.hasOwnProperty(setting.chestTag) || meta.hasOwnProperty(setting.chestTagJP);
- };
- Game_Event.prototype.chestFlash =function(){
- const flash =this.isClosedChest();
- if(flash){
- this.requestBalloon(setting.balloonId);
- }
- return flash;
- };
- /**
- * @param {Game_Event} event
- */
- function _finalPage(event){
- return event._pageIndex ===event.event().pages.length-1
- }
- Game_Event.prototype.isOpendChest=function(){
- return _finalPage(this) &&this.isChest();
- };
- Game_Event.prototype.isClosedChest =function(){
- return !_finalPage(this) &&this.isChest();
- };
- Game_Map.prototype.countOpendChest =function(){
- return countIf(this._events,function(event){
- return event.isOpendChest();
- });
- };
- Game_Map.prototype.countClosedChest =function(){
- return countIf(this._events,function(event){
- return event.isClosedChest();
- });
- };
- Game_Map.prototype.countChest =function(){
- return countIf(this._events,function(event){
- return event.isChest();
- });
- };
- /**
- * @return {Game_Event} 最後にバルーンを出したイベント
- */
- Game_Map.prototype.chestFlash =function(){
- const events = this.events();
- var lastEvent=null;
- events.forEach(function(event){
- if(event){
- if(event.chestFlash()){
- lastEvent =event;
- }
- }
- });
- if(lastEvent){
- AudioManager.playSe(setting.flashSound);
- }
- return lastEvent;
- };
- Game_Map.prototype.showChestCountMessage =function(){
- const count = this.countClosedChest();
- if( count >0 ){
- $gameMessage.add(setting.countChestText.format(count));
- }else{
- $gameMessage.add(setting.countChestEmptyText);
- }
- };
- Game_Interpreter.prototype.chestFlash=function(){
- const event = $gameMap.chestFlash();
- if(setting.flashWait && !!event ){
- this._character =event;
- this.setWaitMode('balloon');
- }
- };
- const Game_Interpreter_pluginCommand =Game_Interpreter.prototype.pluginCommand;
- Game_Interpreter.prototype.pluginCommand =function(command, args){
- if(command ==='ChestFlash'){
- this.chestFlash();
- return;
- }
- if(command ==='CountChest'){
- $gameMap.showChestCountMessage()
- return;
- }
- Game_Interpreter_pluginCommand.apply(this,arguments);
- };
- })();
复制代码
|
最佳答案
查看完整内容
额,你试试脚本直接填$gameMap.showChestCountMessage()
不是变量赋值填脚本,而是事件指令-脚本填$gameMap.showChestCountMessage()
就像填写插件指令一样
|