Chaos Project

RPG Maker => RPG Maker Scripts => Script Requests => Topic started by: Wraith89 on September 10, 2020, 02:00:57 pm

Title: [XP] Giving Weapon Attack Value to Shields, Armour, etc
Post by: Wraith89 on September 10, 2020, 02:00:57 pm
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.
Title: Re: [XP] Giving Weapon Attack Value to Shields, Armour, etc
Post by: KK20 on September 10, 2020, 11:59:02 pm
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