Moghunter's Pick Up & Throw - Minor Edit Request

Ravenith

Veteran
Veteran
Joined
Mar 27, 2012
Messages
263
Reaction score
15
First Language
Greek
Primarily Uses
Heya.

I'm trying to use this plugin (https://atelierrgss.wordpress.com/rmv-pick-up-and-throw/) and stumbled upon an issue with autotiles and the way MV handles their passability.

Long story short, I would like to have a Region in which the player cannot throw events.

I'd like some help to add another check that checks whether the tile's Region is X, and if so, return false.

Any help? Thanks in advance!

Code:
//==============================
// * can Pass Throw
//==============================
Game_CharacterBase.prototype.canPassThrow = function(x, y, d) {
    var x2 = $gameMap.roundXWithDirection(x, d);
    var y2 = $gameMap.roundYWithDirection(y, d);
    if (d === 2) {x3 = x; y3 = y + 1;   
    } else if (d === 4) {x3 = x - 1;y3 = y;       
    } else if (d === 6) {x3 = x + 1;y3 = y;   
    } else {x3 = x;y3 = y - 1;
    };
    if (!$gameMap.isValid(x2, y2)) {
        return false;
    };
    if (this.isThrough() || this.isDebugThrough()) {
        return true;
    };
    if (!$gameMap.isPassable(x3, y3)) {
        return false;
    };
    if (this.isCollidedWithCharacters(x2, y2)) {
        return false;
    };
    return true;
};
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Ami
--- Mushroom ---

F.Knight: We runs out the food!
Hero: Anything could eat in this place?
F.Archer: It's a bunch of Mushroom over there. I wonder it's safe to eat.
F.Knight: No worries,we have to fill our inside no matter what it is.
(Hero & F.Knight Eat The Mushroom,After 10 Seconds They Collapse With Foam)
I hope I'm not the only one super excited about the Minecraft Live broadcast on Friday! (At least, Friday for me) I'm planning to catch it because I need to get my vote in there and add a mob to the game! I hope I'll see some of you there!
Hyptosis wrote on Sharm's profile.
Whoa, was browsing the forum and stumbled onto you account! Big fan of your work!

Forum statistics

Threads
103,442
Messages
999,327
Members
134,976
Latest member
Ulrick-Deamon
Top