[XP] Giving Weapon Attack Value to Shields, Armour, etc

Started by Wraith89, September 10, 2020, 02:00:57 pm

Previous topic - Next topic

Wraith89

In the default database settings, weapon attack value can only be given to weapons for obvious reasons. In the armour tab, the option to give weapon attack value is not there and is replaced with evasion. Is there any way to script call or add this option to make shields give weapon attack value, for example? Thank you.

KK20

module ArmorAtkConfig
  def self.atk_for(id)
    case id
    #--------------------------------
    # when armor_id then atk_bonus
    when 1 then 100
    #--------------------------------
    else
      0
    end
  end
 
end


class Game_Actor
  alias get_orig_base_atk base_atk
  def base_atk
    atk = get_orig_base_atk
    for i in 1..4
      armor_id = instance_variable_get("@armor#{i}_id")
      atk += ArmorAtkConfig.atk_for(armor_id)
    end
    atk
  end
end

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!