Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module BestiaryPatch
- # Background settings for the battle scan window.
- # It is automatically centered on the enemy stat window, but you can
- # offset this position in the settings.
- # The image used must be in the "Graphics/Pictures/" folder!
- Back = {
- :img => "Title", # Image name.
- :offset => [0,0], # Offset values. Format: [x,y] .
- :opa => 100, # Opacity.
- }
- end
- class Window_BestiaryStatSelection < Window_Selectable
- def initialize(x, y, width, height)
- yy = SceneManager.scene_is?(Scene_Bestiary) ? 66 : y
- super(x, yy, width, height)
- set_windowskin
- select(0)
- hide
- refresh
- end
- end
- class Window_BestiaryStats < Window_Base
- def initialize(x, y, width, height)
- @win_height = height
- yy = SceneManager.scene_is?(Scene_Bestiary) ? 90 : y
- super(x, yy, width, height)
- self.opacity = 0
- @enemy = nil
- init_back_img if SceneManager.scene_is?(Scene_Battle)
- hide
- end
- def init_back_img
- @back = Sprite.new
- @back.bitmap = Cache.picture(BestiaryPatch::Back[:img])
- @back.x = self.x + self.width / 2 + BestiaryPatch::Back[:offset][0]
- @back.y = self.y + self.height / 2 + BestiaryPatch::Back[:offset][1]
- @back.ox = @back.bitmap.width/2
- @back.oy = @back.bitmap.height/2
- @back.viewport = self.viewport
- @back.z = self.z - 1
- @back.opacity = BestiaryPatch::Back[:opa]
- end
- def hide
- super
- @back.visible = false if @back
- end
- def show
- super
- @back.visible = true if @back
- end
- def draw_basic_stats
- elements = Venka::Bestiary::Elements.size
- states = Venka::Bestiary::States.size
- height = (elements / 2 + elements % 2) + (states / 2 + states % 2) + 10
- height += 6 if Venka::Bestiary::Show_Debuff_Info
- determine_window_height(height)
- yy = SceneManager.scene_is?(Scene_Bestiary) ? 12 : 5
- draw_line(yy)
- @y = 12
- draw_main_stats
- draw_line(@y + 5)
- @y += 12
- get_revealed_resists
- draw_elements
- draw_line(@y + 5)
- @y += 12
- draw_states
- return unless Venka::Bestiary::Show_Debuff_Info
- draw_line(@y + 5)
- @y += 12
- draw_debuffs
- end
- def draw_other_info
- drops = @enemy.drop_items.select {|d| d.kind > 0 }
- ids = []
- @enemy.actions.each do |action|
- ids << action.skill_id unless ids.include?(action.skill_id)
- end
- height = 5 + drops.size + ids.size
- determine_window_height(height)
- yy = SceneManager.scene_is?(Scene_Bestiary) ? 12 : 5
- draw_line(yy)
- @y = 12
- set_bestiary_font(:header_font)
- draw_text(0, @y, contents.width, font_height, Venka::Bestiary::Loot_Text, 1)
- @y += font_height
- draw_exp_and_gold
- draw_drops
- draw_skills
- end
- def dispose
- super
- if @back
- @back.bitmap.dispose
- @back.dispose
- end
- end
- end
- class Scene_Bestiary < Scene_MenuBase
- def terminate
- super
- if @map_bgm
- fadeout_all(60)
- @map_bgm.replay
- end
- dispose_enemy_image
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement