Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Sprite_Desc
- attr_writer :z
- def visible=(visible)
- dispose
- end
- def bitmap
- self
- end
- def dispose
- @bitmap.dispose if @bitmap
- end
- def refresh(item)
- x = Mouse.x + 12 + 200 > Graphics.width ? Graphics.width - 200 : Mouse.x + 12
- y = Mouse.y + 12 + 170 > Graphics.height ? Graphics.height - 170 : Mouse.y + 12
- position = Display::Position.new x, y
- if item.is_a?(RPG::Item)
- i = Display::Consumable::Data.new
- i.name = item.name
- i.description = item.description
- i.level = item.level
- i.consumable = item.consumable
- i.key_item = item.key_item?
- @bitmap = Display::Consumable::Renderer.new(position, i)
- elsif item.is_a?(RPG::EquipItem)
- i = Display::Equippable::Data.new
- i.name = item.name
- i.description = item.description
- i.level = item.level
- i.equippable = $game_actors[1].equippable?(item)
- i.attributes = {
- 'atk' => item.params[0],
- 'def' => item.params[1],
- 'matk' => item.params[2],
- 'mdef' => item.params[3],
- 'agi' => item.params[4],
- 'luck' => item.params[5],
- 'mhp' => item.params[6],
- 'mmp' => item.params[7]
- }
- i.price = item.price
- x = Mouse.x + 12 + 200 > Graphics.width ? Graphics.width - 200 : Mouse.x + 12
- y = Mouse.y + 12 + 255 > Graphics.height ? Graphics.height - 255 : Mouse.y + 12
- position = Display::Position.new x, y
- @bitmap = Display::Equippable::Renderer.new(position, i)
- else
- i = Display::Skill::Data.new
- i.name = item.name
- i.description = item.description
- i.base_damage = item.damage.eval($game_actors[1], Game_Battler.new, $game_variables).abs
- i.mp_cost = item.mp_cost
- i.precision = item.success_rate
- @bitmap = Display::Skill::Renderer.new(position, i)
- end
- @bitmap.render
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement