Weapon/Armor HP/SP Plus by Blizzard and Multi Slot Script

Started by syldocaine, January 17, 2014, 08:37:20 am

Previous topic - Next topic

syldocaine

Hi guys

I just wanted to ask if there is a way to make Blizzards Weapon/Armor HP/SP Plus Script compatible with GUILLAUME777's Multi-Slot Script.
Atm it can't "see" if there are more slots as the usual ones: weapon_id and armor1_id, armor2_id, armor3_id, armor4_id.

Thx in advance.

KK20

Try replacing the two methods in the script with this

 alias base_maxhp_hpsp_add_on_later base_maxhp
 def base_maxhp
   return base_maxhp_hpsp_add_on_later unless $game_system.HPSPPLUS
   plus, multi = 0, 1.0
   self.equipments.each{|equip|
     if equip.is_a?(RPG::Weapon)
       result = BlizzCFG.weapon_hp_plus(equip.id)
       result[0] ? (multi *= result[1]) : (plus += result[1])
     else
       result = BlizzCFG.armor_hp_plus(equip.id)
       result[0] ? (multi *= result[1]) : (plus += result[1])
     end
   }
   return (multi * (plus + base_maxhp_hpsp_add_on_later)).to_i
 end
 
 alias base_maxsp_hpsp_add_on_later base_maxsp
 def base_maxsp
   return base_maxsp_hpsp_add_on_later unless $game_system.HPSPPLUS
   plus, multi = 0, 1.0
   self.equipments.each{|equip|
     if equip.is_a?(RPG::Weapon)
       result = BlizzCFG.weapon_sp_plus(equip.id)
       result[0] ? (multi *= result[1]) : (plus += result[1])
     else
       result = BlizzCFG.armor_sp_plus(equip.id)
       result[0] ? (multi *= result[1]) : (plus += result[1])
     end
   }
   return (multi * (plus + base_maxsp_hpsp_add_on_later)).to_i
 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!

syldocaine


Thx alot!

There were just two little bugs were it doesnt't recognized the HP/SP of the armors.
I changed
result = BlizzCFG.armor_hp_plus(id) to result = BlizzCFG.armor_hp_plus(equip.id)
and
result = BlizzCFG.armor_sp_plus(id) to result = BlizzCFG.armor_sp_plus(equip.id)

and it all works fine now.

thumps up for you  8)


KK20

Derp. We programmers love to use copy/paste so much that we forget the minor things like that. Fixed in original post.

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!