-
-
Save aaaaagold/45f38d571436c0e82658841db2bc33e8 to your computer and use it in GitHub Desktop.
an rmmv plugin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
/*: | |
* @plugindesc 讓事件可以只穿透事件而不穿透玩家 | |
* @author agold404 | |
* | |
* @help this plugin let you set events through only events but not player (and followers) | |
* | |
* syntax: write <throughEvents> in note of a event | |
* this will let the event can be through all events | |
* | |
* syntax: write <throughEventsOnly:A_USER_DEFINED_STRING> in note of a event | |
* this will let the event can be through all events having same 'meta.throughEventsOnly' (leave it empty can be a classification) in notes only | |
* | |
* remember to uncheck "through" | |
* | |
* This plugin can be renamed as you want. | |
*/ | |
(()=>{ | |
{ const p=Game_Event.prototype , k='isCollidedWithEvents'; | |
const r=p[k]; (p[k]=function f(x,y){ | |
const meta=this.event().meta , k='throughEventsOnly'; | |
if(meta.throughEvents) return false; | |
else if(Object.hasOwnProperty.call(meta,k)) return $gameMap._events.filter(e=>e&&!e._through&&e.pos(x,y)&&meta[k]!==e.event().meta[k]).length!==0; | |
else return $gameMap._events.filter(e=>e&&!e._through&&e.pos(x,y)).length!==0; | |
}).ori=r; | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment