❤❣ღ rpg maker mv收集 ❤❣ღ
㊕rpg maker mv新功能☪

〄数据库道具上限提升 ✿自动三层级地图
☪高分辨率游戏画面 触屏控制✿
____________________________________________
多设备支持:
输出Windows exe文件、Mac App文件、安卓Apk和iOS ipa✿
Mac、android、windows☪

即使你不用懂编程☪、不用会代码,依然能制作属于自己游戏✿
————————————————
转载于插件の素材の等资源,免费下载☪
✉开发: KADOKAWA ✿ Yoji Ojima
✉发行: Degica
 

显示和隐藏区域Dark Room Covers Not rated

暗间客房面积 

允许显示和隐藏区域。

//=============================================================================

// MrTS_DarkRoomCovers.js

//=============================================================================


/*:

* @plugindesc Hides or reveals regions.

* @author Mr. Trivel

* @help

* --------------------------------------------------------------------------------

* Terms of Use

* --------------------------------------------------------------------------------

* Don't remove the header or claim that you wrote this plugin.

* Credit Mr. Trivel if using this plugin in your project.

* Free for non-commercial projects.

* For commercial use contact Mr. Trivel.

* --------------------------------------------------------------------------------

* Version 1.0

* --------------------------------------------------------------------------------

*

* --------------------------------------------------------------------------------

* Map Property Tags

* --------------------------------------------------------------------------------

* --------------------------------------------------------------------------------

* --------------------------------------------------------------------------------

* Plugin Commands

* --------------------------------------------------------------------------------

* RegionReveal [ID] - Reveals tiles of specific region

* RegionHide [ID] - Hides tiles of specific region

* --------------------------------------------------------------------------------

* --------------------------------------------------------------------------------

* Version History

* --------------------------------------------------------------------------------

* 1.0 - Release

*/


(function() {


//--------------------------------------------------------------------------

// Game_Interpreter

// 

var _Game_Interpreter_pluginCommand = Game_Interpreter.prototype.pluginCommand;

Game_Interpreter.prototype.pluginCommand = function(command, args) {

_Game_Interpreter_pluginCommand.call(this, command, args);

if (command.toLowerCase() === "regionreveal") {

$gameMap.setShowRegionId(Number(args[0]));

} else if (command.toLowerCase() === "regionhide") {

$gameMap.setHideRegionId(Number(args[0]));

}

};


//----------------------------------------------------------------------------

// Game_Map

// 


// showRegionId

Game_Map.prototype.setShowRegionId = function(id) {

if (!this._showRegionId) this._showRegionId = [];

this._showRegionId.push(id);

this.addToCurrentlyOpenRegions(id);

};


Game_Map.prototype.getShowRegionId = function() {

if (!this._showRegionId) this._showRegionId = [];

return this._showRegionId;

};


Game_Map.prototype.eraseShowRegionId = function() {

this._showRegionId = [];

};


// hideRegionId

Game_Map.prototype.setHideRegionId = function(id) {

if (!this._hideRegionId) this._hideRegionId = [];

this._hideRegionId.push(id);

this.removeFromCurrentlyOpenRegions(id);

};


Game_Map.prototype.getHideRegionId = function() {

if (!this._hideRegionId) this._hideRegionId = [];

return this._hideRegionId;

};


Game_Map.prototype.eraseHideRegionId = function() {

this._hideRegionId = [];

};


// currentlyOpenRegions

Game_Map.prototype.currentlyOpenRegions = function() {

if (!this._openRegionIds) this._openRegionIds = [];

return this._openRegionIds;

};


Game_Map.prototype.addToCurrentlyOpenRegions = function(id) {

if (!this._openRegionIds) this._openRegionIds = [];

if (!this._openRegionIds.contains(id)) this._openRegionIds.push(id);

};


Game_Map.prototype.removeFromCurrentlyOpenRegions = function(id) {

if (!this._openRegionIds) return;

this._openRegionIds.splice(this._openRegionIds.indexOf(id), 1);

};


Game_Map.prototype.resetCurrentlyOpenRegions = function() {

this._openRegionIds = [];

};


//----------------------------------------------------------------------------

// Scene_Map

// 


var _SceneMap_createDisplayObjects = Scene_Map.prototype.createDisplayObjects;

Scene_Map.prototype.createDisplayObjects = function() {

_SceneMap_createDisplayObjects.call(this);

this.createDarkCover();

};


Scene_Map.prototype.createDarkCover = function() {

this._darkCover = new Spriteset_DarkCover();

this._spriteset.addChild(this._darkCover);

};


//--------------------------------------------------------------------------

// Spriteset_DarkCover

//

// Covers regions with dark dark darkness.

function Spriteset_DarkCover() {

this.initialize.apply(this, arguments);

};

Spriteset_DarkCover.prototype = Object.create(Sprite.prototype);

Spriteset_DarkCover.prototype.constructor = Spriteset_DarkCover;

Spriteset_DarkCover.prototype.initialize = function() {

Sprite.prototype.initialize.call(this);

this.setFrame(0, 0, Graphics.width, Graphics.height);

this._tone = [0, 0, 0, 0];

this.opaque = true;

this._darkCovers = [];

this.createDarkCovers();

this.update();

};


Spriteset_DarkCover.prototype.createDarkCovers = function() {

var bitmap = new Bitmap(48, 48);

bitmap.fillAll('#000000');

for (var j = 0; j < $gameMap.height(); j++) {

this._darkCovers.push([]);

for (var i = 0; i < $gameMap.width(); i++) {

var cover = new Sprite(bitmap);

cover.x = i * 48;

cover.y = j * 48;

cover.visible = false;

if ($gameMap.regionId(i, j) > 0)

  cover.visible = !$gameMap.currentlyOpenRegions().contains($gameMap.regionId(i, j));

else

cover.visible = false;

this._darkCovers[j].push(cover);

this.addChild(cover);

}

}

};


Spriteset_DarkCover.prototype.update = function() {

Sprite.prototype.update.call(this);

this.x = -$gameMap.displayX() * $gameMap.tileWidth();

this.y = -$gameMap.displayY() * $gameMap.tileHeight();

if ($gameMap.getShowRegionId().length > 0)

{

for (var j = 0; j < $gameMap.height(); j++) {

for (var i = 0; i < $gameMap.width(); i++) {

if ($gameMap.getShowRegionId().contains($gameMap.regionId(i, j)))

this._darkCovers[j][i].visible = false;

}

}

$gameMap.eraseShowRegionId();

}

if ($gameMap.getHideRegionId().length > 0)

{

for (var j = 0; j < $gameMap.height(); j++) {

for (var i = 0; i < $gameMap.width(); i++) {

if ($gameMap.getHideRegionId().contains($gameMap.regionId(i, j)))

this._darkCovers[j][i].visible = true;

}

}

$gameMap.eraseHideRegionId();

}

};

})();





Name: Dark Room Covers

Version: 1.0

Author: Mr. Trivel

Created: 2016-02-17

What does it do?

Allows to show and hide regions. 

How to use?

Everything is set up using Plugin Commands.

And we have a couple of those:

RegionReveal [ID] – Reveals tiles of specific region.

RegionHide [ID] – Hides tiles of specific region.

[ID] being region ID.

Simple as that.

Example of calls:

RegionReveal 5 RegionHide 4

Plugin: <GitHub>

How to download Plugin. Click the link above, there will be a button named Raw, press Right Click -> Save As.

Terms of Use:

Don’t remove the header or claim that you wrote this plugin.

Credit Mr. Trivel if using this plugin in your project.

Free for non-commercial projects.

For commercial use contact Mr. Trivel.


 
评论
 
热度(2)
  1. 共1人收藏了此文字
只展示最近三个月数据