Help with a Poisoning Script

Discussion in 'Learning Javascript' started by Zacyiia, Dec 2, 2017.

  1. Zacyiia

    Zacyiia The Endless Void Member

    Messages:
    11
    Likes Received:
    0
    First Language:
    English
    Primarily Uses:
    RMMV
    I am writing a plugin that will reduce the party's hp by 10 points per step If they should enter a map without the right key Item.
    What I plan on having this plugin check for is the following:

    -If one of eight map events are present

    -If one of these map events is present; check for one of the nessacery Key Items
    Ex: Fire Power Glove / Wind & Fire Power Glove / Fire & Water Power Glove

    If the player enters an area where a Fire Event is present and has a Power Glove upgraded with Fire, then no health will be lost.
    If the player enters an area where a Fire Event is present and has a Power Glove, but is not upgraded with Fire, then they will lose 10 hp each step.

    Right now my plugin is able to check for the Game Variable 1 (which I named fire), and if the variable is not equal to 1, then the
    player takes -10 hp each step. I am not really sure how to make the two checks above so that I can just use the Key Item instead of variables. Also I don't know how to affect the entire party at once in regards to $gameActors.actor().gainHp().

    Here is my code so far:

    (function() {
    Game_Player.prototype.executeMove = function(direction) {
    this.moveStraight(direction);

    if ($gameVariables.value(1) != 1 ){
    $gameActors.actor(1).gainHp(-10)
    $gameActors.actor(2).gainHp(-10)
    $gameActors.actor(3).gainHp(-10)
    }
    };
    })();
     
    #1

Share This Page