ImmuneEntity
Sponsor
I'm trying to edit the Shop windows so that it will display ALL attribute changes for weapons and armor, not just ATK, MDEF, and PDEF. Here is the section of code I am having troubles with:
The problem is that it crashes in the shop scene because it says something about an undefined method for Weapon. It seems that a Weapon does not have a method for dex, agi, or int. But I cannot find where the atk method is for Weapon so that I can add those other methods. Any ideas?
Code:
    # If weapon
    if @item.is_a?(RPG::Weapon)
     atk1 = item1 != nil ? item1.atk : 0
     atk2 = @item != nil ? @item.atk : 0
     change = atk2 - atk1
     atk1 = item1 != nil ? item1.atk : 0
     atk2 = @item != nil ? @item.atk : 0
     atkChange = atk2 - atk1
    end
   Â
    pdef1 = item1 != nil ? item1.pdef : 0
    mdef1 = item1 != nil ? item1.mdef : 0
    pdef2 = @item != nil ? @item.pdef : 0
    mdef2 = @item != nil ? @item.mdef : 0
    pdefChange = pdef2 - pdef1
    mdefChange = mdef2 - mdef1
   Â
    dex1 = item1 != nil ? item1.dex : 0
    dex2 = @item != nil ? @item.dex : 0
    dexChange = dex2 - dex1
   Â
    agi1 = item1 != nil ? item1.agi : 0
    agi2 = @item != nil ? @item.agi : 0
    agiChange = agi2 - agi1
   Â
    int1 = item1 != nil ? item1.int : 0
    int2 = @item != nil ? @item.int : 0
    intChange = int2 - int1
The problem is that it crashes in the shop scene because it says something about an undefined method for Weapon. It seems that a Weapon does not have a method for dex, agi, or int. But I cannot find where the atk method is for Weapon so that I can add those other methods. Any ideas?