Advertisement
diamondandplatinum3

Patch: (FE/D Weapon Sytem | Apply WType Limit to Classes)

Nov 22nd, 2013
431
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 4.00 KB | None | 0 0
  1. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  2. #
  3. # Patch for DP3's "Fire Emblem / Disgaea" Weapon System.
  4. #
  5. #   This Patch allows you to apply the '  ~DoNotEquip  ' NoteTag
  6. #    to actor classes rather than the Actors themselves.
  7. #
  8. # *~ Place this Patch in a script slot below the original Script
  9. #
  10. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  11.  
  12.  
  13.  
  14.  
  15.  
  16. #==============================================================================
  17. # ** Game_Actor
  18. #------------------------------------------------------------------------------
  19. #  This class handles actors. It is used within the Game_Actors class
  20. # ($game_actors) and is also referenced from the Game_Party class ($game_party).
  21. #==============================================================================
  22.  
  23. class Game_Actor < Game_Battler
  24.   #--------------------------------------------------------------------------
  25.   # * Determine if Weapon Level is Sufficient
  26.   #--------------------------------------------------------------------------
  27.   def dp3_is_weapon_level_sufficient(weapon)
  28.     # Do Not Equip Weapon Type Notetag
  29.     if $data_classes[self.class_id].note =~ /~DoNotEquip\[\s*(.+?)\]/im
  30.       do_not_equip_types = $1.scan(/\d+/).collect {|i| i.to_i }
  31.       return false if do_not_equip_types.include?(weapon.wtype_id)
  32.     end
  33.     #~~~~~
  34.     return true if weapon.wtype_id == 0
  35.     $data_weapons[weapon.id].note[/~WeaponLevel:\s*(.+)/i]
  36.     return true unless $1 && $1 != ""
  37.     method_args = [ weapon.wtype_id, self.id, @dp3_weapon_level[weapon.wtype_id - 1] ]
  38.     curr_skill = DiamondandPlatinum3::WeaponLevels::get_current_weapon_level( *method_args )
  39.     return DiamondandPlatinum3::WeaponLevels::get_skilllevel_and_weapon_compatible( curr_skill, $1.upcase )  
  40.   end
  41. end
  42.  
  43. #==============================================================================
  44. # ** Window_WeaponLevelStatus
  45. #------------------------------------------------------------------------------
  46. #  This window displays full status specs on the Weapon Ranks.
  47. #==============================================================================
  48.  
  49. class Window_WeaponLevelStatus < Window_Selectable
  50.   #--------------------------------------------------------------------------
  51.   # * Draw Weapon Level Info
  52.   #--------------------------------------------------------------------------
  53.   def draw_weapon_level_info()
  54.     $data_classes[@actor.class_id].note[/~DoNotEquip\[\s*(.+?)\]/im]
  55.     do_not_equip_types = $1 ? $1.scan(/\d+/).collect {|i| i.to_i } : []
  56.     yPos_Correction = 25
  57.     while((yPos_Correction * (WeaponAccumulation.size - do_not_equip_types.size)) >= ((@yPos + self.height) - 20))
  58.       yPos_Correction -= 1
  59.       break if yPos_Correction <= 10
  60.     end
  61.     for i in 1..WeaponAccumulation.size
  62.       # Skip this Weapon Type?
  63.       next if do_not_equip_types.include?(i)
  64.       # Get Current Weapon Skill
  65.       curr_skill = get_current_weapon_skill(i)
  66.       # Draw Icon
  67.       draw_icon(WeaponStatusMenuInfo[:weapon_icon_id][i][0], @xPos, @yPos, 24, yPos_Correction)
  68.       @xPos += 25
  69.       # Draw Gauge
  70.       rate = get_next_level_up_rate(i, curr_skill)
  71.       draw_gauge(@xPos, @yPos - 5, 150, rate, get_gaugecolour1, get_gaugecolour2)
  72.       @xPos += 175 # Gauge Width Plus 25 Offset
  73.       # Draw Weapon Level
  74.       self.change_color(get_weapon_level_colour( curr_skill ))
  75.       draw_text(@xPos, @yPos, 25, 25, curr_skill)
  76.       self.change_color(normal_color)
  77.       @xPos += 25
  78.       # Draw Weapon Bonuses
  79.       for j in 0..4
  80.         draw_icon(WeaponStatusMenuInfo[:bonusparam_icon_id][j + 1][0], @xPos, @yPos, 24, yPos_Correction)
  81.         @xPos += 29
  82.         bonus = self.get_actor_bonus_param( i, j, curr_skill )
  83.         text = bonus.to_s
  84.         self.change_color(get_weapon_bonus_colour( bonus, i ))
  85.         draw_text(@xPos, @yPos, 23, yPos_Correction, text)
  86.         self.change_color(normal_color)
  87.         @xPos += 26
  88.       end
  89.       @xPos = 20
  90.       @yPos += yPos_Correction
  91.     end
  92.   end
  93. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement