Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #==============================================================================
- # DSI Hide Enemy Stats In Battle
- # -- Last Updated: 2017.07.20
- # -- Author: dsiver144
- # -- Level: Easy
- # -- Requires: n/a
- #==============================================================================
- $imported = {} if $imported.nil?
- $imported["DSI-HideEnemyStats"] = true
- #==============================================================================
- # + Updates
- # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- # 2017.07.20 - Finish first version.
- #==============================================================================
- # + Instructions
- # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- # To install this script, open up your script editor and copy/paste this script
- # to an open slot below ?? Materials/?f?? but above ?? Main. Remember to save.
- # * You should put this script below all script relate to drawing enemy stats.
- # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- # Enemy's Notetags:
- # + <hide hp>
- # + <hide mp>
- # + <hide tp>
- # + <hide shield>
- # + <hide all>
- #==============================================================================
- module DSIVER144
- module HIDE_ENEMY_STATS
- Regexp = {}
- Regexp[1] = /<hide[ _]hp>/i
- Regexp[2] = /<hide[ _]mp>/i
- Regexp[3] = /<hide[ _]tp>/i
- Regexp[4] = /<hide[ _]shield>/i
- Regexp[5] = /<hide[ _]all>/i
- end # HIDE_ENEMY_STATS
- end # DSIVER144
- class Game_System
- include DSIVER144::HIDE_ENEMY_STATS
- alias_method(:dsi_load_notetag_enemies_hide_stats, :initialize)
- #----------------------------------------------------------------------------
- # * alias method: update_hpmpinfo
- #----------------------------------------------------------------------------
- def initialize
- dsi_load_notetag_enemies_hide_stats
- $data_enemies.each do |enemy|
- next if enemy.nil?
- enemy.hide_stats ||= {}
- enemy.note.split(/[\r\n]+/).each do |line|
- [:hp,:mp,:tp,:shp].each_with_index do |key,index|
- if (line =~ Regexp[index + 1]) || (line =~ Regexp[5])
- enemy.hide_stats[key] = true
- end
- end
- end
- end
- end
- end
- class RPG::Enemy
- attr_accessor :hide_stats
- end # RPG::Enemy
- class Game_Enemy < Game_Battler
- #----------------------------------------------------------------------------
- # * new method: hide_stats
- #----------------------------------------------------------------------------
- def hide_stats
- $data_enemies[@enemy_id].hide_stats
- end
- end # Game_Enemy
- class Sprite_Battler
- #----------------------------------------------------------------------------
- # * overwrite method: update_hpmpinfo
- #----------------------------------------------------------------------------
- def update_hpmpinfo
- create_ehpmpwindow if @ehpmp_window.nil?
- @ehpmp_window.visible = @battler.alive? || @battler.hidden?
- return if !@battler.alive? || !@ehpmp_window.visible
- @ehpmp_window.update
- @ehpmp_window.contents_opacity = self.opacity if @ehpmp_window.contents_opacity != self.opacity
- @ehpmp_window.y = self.y + EnemyHPMPIcons::Y_OFFSET - self.height - @ehpmp_window.height
- @ehpmp_window.y = 0 if @ehpmp_window.y < 0
- @ehpmp_window.contents.clear
- width = @ehpmp_window.contents.width - @ehpmp_window.padding
- if EnemyHPMPIcons::TEXTCOLOR.is_a?(Array)
- @ehpmp_window.contents.font.color.set(Color.new(EnemyHPMPIcons::TEXTCOLOR[0], EnemyHPMPIcons::TEXTCOLOR[1], EnemyHPMPIcons::TEXTCOLOR[2]))
- else
- @ehpmp_window.change_color(@ehpmp_window.text_color(EnemyHPMPIcons::TEXTCOLOR))
- end
- stat_y = 0
- index = 0
- if !@battler.hide_stats[:hp]
- offset_y = index == 0 ? 0 : EnemyHPMPIcons::Y_SPACING
- @ehpmp_window.draw_icon(EnemyHPMPIcons::HP_ICON, 0, stat_y + offset_y)
- @ehpmp_window.draw_text(24 + EnemyHPMPIcons::SPACING, stat_y, width, EnemyHPMPIcons::TEXT_SIZE, @battler.hp.to_s + "/" + @battler.mhp.to_s)
- stat_y += EnemyHPMPIcons::TEXT_SIZE
- index += 1
- end
- if !@battler.hide_stats[:mp]
- offset_y = index == 0 ? 0 : EnemyHPMPIcons::Y_SPACING
- @ehpmp_window.draw_icon(EnemyHPMPIcons::MP_ICON, 0, stat_y + offset_y)
- @ehpmp_window.draw_text(24 + EnemyHPMPIcons::SPACING, stat_y + offset_y, width, EnemyHPMPIcons::TEXT_SIZE, @battler.mp.to_s + "/" + @battler.mmp.to_s)
- stat_y += EnemyHPMPIcons::TEXT_SIZE
- index += 1
- end
- if !@battler.hide_stats[:tp]
- offset_y = index == 0 ? 0 : EnemyHPMPIcons::Y_SPACING
- @ehpmp_window.draw_icon(Icons::TP_Icon, 0, stat_y + offset_y)
- @ehpmp_window.draw_text(24 + EnemyHPMPIcons::SPACING, stat_y + offset_y, width, EnemyHPMPIcons::TEXT_SIZE, @battler.tp.to_i.to_s + "/" + 5.to_s)
- stat_y += EnemyHPMPIcons::TEXT_SIZE
- index += 1
- end
- if !@battler.hide_stats[:shp]
- offset_y = index == 0 ? 0 : EnemyHPMPIcons::Y_SPACING
- @ehpmp_window.draw_icon(Icons::SHIELD_Icon, 0, stat_y + offset_y)
- @ehpmp_window.draw_text(24 + EnemyHPMPIcons::SPACING, stat_y + offset_y, width, EnemyHPMPIcons::TEXT_SIZE, @battler.shp.to_s + "/" + @battler.mshp.to_s)
- stat_y += EnemyHPMPIcons::TEXT_SIZE
- index += 1
- end
- end
- end # Sprite_Battler
- #===============================================================================
- # * END OF FILE
- #===============================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement