I quickly tested it in the function where it updates the weather sprites by setting the sprite visibility to false depending on it's coordinate. It seemed to work quite nicely* (check below) when I checked for a region id, but for some reason it worked much poorer when checking for a tile id (even when checking just one layer, not all). Here's where checking the region id:
Weather.prototype._updateAllSprites = function() {
const maxSprites = Math.floor(this.power * 10);
while (this._sprites.length < maxSprites) {
this._addSprite();
}
while (this._sprites.length > maxSprites) {
this._removeSprite();
}
for (const sprite of this._sprites) {
this._updateSprite(sprite);
sprite.x = sprite.ax - this.origin.x;
sprite.y = sprite.ay - this.origin.y;
const regionId = 1;
if ($gameMap.regionId($gameMap.canvasToMapX(sprite.x), $gameMap.canvasToMapY(sprite.y)) === regionId) {
sprite.visible = false;
} else {
sprite.visible = true;
}
}
};
Then I also tried to check coordinates I pushed into a game variable array (which can be easily modified), and it seemed to work quite nicely there too (hope I didn't manage to confuse myself here LOL). So the conditional was like:
if ($gameVariables.value(20).some(value => value[0] === $gameMap.canvasToMapX(sprite.x) && value[1] === $gameMap.canvasToMapY(sprite.y)))
*Now when I say quite nicely, the biggest problem was that the sprites could still appear at the very top of the screen for a small while. If you want to get rid of that, I guess you have to mofidy the _rebornSprite method to make it not able to throw the sprites to certain x-coordinates depending on whatever you're using.
Then there's also the dimmer sprite, that darkens the screen for weather effects. If you don't want the darkness to apply to the house insides, you'll have to modify that too. As I understand you should be able to slice parts away with clearRect(), you just need to get the correct coordinates on your screen where the regions/tileIds/coordinates are and then use that and fill in the update method. No idea how efficiently that runs though.
Well, maybe someone can tell you how to do it cleanly, anyway good luck LOL!
EDIT: Not sure but the sprites flashing at the top might only happen at the very top of the map? Also, the biggest storm sprites will overlap somewhat the rightmost tiles.
Yeah cool, in your modified script you're checking for the $gamePlayer.terraintag. Check the sprites:
if ($gameMap.terrainTag($gameMap.canvasToMapX(sprite.x), $gameMap.canvasToMapY(sprite.y)) === terrainTag)
Also note the edit I wrote at the end of my last post.