SRD_PKM_TypeSystem

Discussion in 'Javascript/Plugin Support' started by PhxFire, Aug 9, 2019.

  1. PhxFire

    PhxFire The Eternal Flame Veteran

    Messages:
    128
    Likes Received:
    65
    First Language:
    English
    Primarily Uses:
    RMMV
    I'm trying to change the damage done from super effective and not very effective moves... I want super effective moves to do 1.25x dmg and not very effective moves to do .75x dmg. I think I found the code but I wanted to see if its the right spot and if I've got the numbers down.


    Code:
        if(defElements.length > 0 && atkElement > 0) {
            for(var i = 0; i < SRD.PKM.TypeSystem.superEffective[atkElement].length; i++) {
                if(defElements.contains(String(SRD.PKM.TypeSystem.superEffective[atkElement][i]))) {
                    effectiveness += 1;
                }
            }
    
            for(var i = 0; i < notVeryEffective[atkElement].length; i++) {
                if(defElements.contains(String(notVeryEffective[atkElement][i]))) {
                    effectiveness -= 1;
                }
            }
    If I change it to this, will I receive the desired results?

    Code:
     if(defElements.length > 0 && atkElement > 0) {
            for(var i = 0; i < SRD.PKM.TypeSystem.superEffective[atkElement].length; i++) {
                if(defElements.contains(String(SRD.PKM.TypeSystem.superEffective[atkElement][i]))) {
                    effectiveness += .25;
                }
            }
    
            for(var i = 0; i < notVeryEffective[atkElement].length; i++) {
                if(defElements.contains(String(notVeryEffective[atkElement][i]))) {
                    effectiveness -= .25;
                }
            }
    Link to plugin here
     
    #1

Share This Page