Also Scripte welche Bilder/Icons nutzen sind folgende.
Pearl Life Bars
Einfach nach
PearlKernel.draw_hp(self.bitmap,battler, h[0], h[1], h[2], h[3], hc) suchen.
Da drunter werden weitere Bilder angezeigt.
#===============================================================================
# * Falcao Pearl ABS script shelf # 7
#
# Actor / Eenemies HP and MP bars display v 2.0
#
# This script acts like an Add-On, the main system can run without this piece
#
#-------------------------------------------------------------------------------
# * Features
# - Display HP, MP, experience and TP bars of the current player actor
# - Display the Enemy HP bar when was hit
# - Boss HP bar anabled
# - Display enemy states and buff / debuff icons
# - Non-graphical bars but hightly customizable
# - 2.0 now support images instead of script drawing bars
# * Usage and Installation
# Just copy and paste below the Pearl ABS System
#
# * Commands
# PearlBars.hide - Hide the actor bars
# PearlBars.show - Show the actor bars (by default)
#
# PearlBars.enemy_auto(id)- Show automatically the enemy HP bars without need
# to hit, this is mostly used for bosses, change id for the event id
# Tag any enemy with Enemy Boss Bar = true to eneble the boss bar mode
#------------------------------------------------------------------------------
module PearlBars
#=============================================================================
# * Actors bars configuration
#
# Bars x and y position on the screen
ScreenPos_X = 10
ScreenPos_Y = 10
#
# Dimentions of the bars you cant exceed 300 width x 100 height
# x y width height
HP_BarDimentions = [8, 16, 118, 14]
MP_BarDimentions = [8, 36, 118, 14]
EX_BarDimentions = [8, 57, 118, 10]
# Tp info x y
TP_Info = [8, 64]
#
# color definition
# color 1 R G B Opa color 2 R G B Opa
HP_Color = [Color.new(205, 255, 205, 200), Color.new(10, 220, 45, 200)]
MP_Color = [Color.new(180, 225, 245, 200), Color.new(20, 160, 225, 200)]
EX_Color = [Color.new(180, 225, 245, 200), Color.new(20, 160, 225, 200)]
# Do you want to display graphics instead of script drawing bars?
# if so, fill this actors bars graphics requirements
ActorsHp = "" # Actor Hp graphic bar name (inside quotation marks)
ActorsMp = "" # Actor Mp graphic bar name
ActorsExp = "" # Actor Experience, if you dont want it leave it ""
ActorsBack = "" # Background semi-transparent bar
#=============================================================================
# * Normal Enemies bars
#
# Normal enemies Bars x and y position on the screen
NeScreenPos_X = 390
NeScreenPos_Y = 10
#
# Dimentions of the bars you cant exceed 300 width x 100 height
# x y width height
EHP_BarDimentions = [8, 16, 126, 10]
#
# color definition
# color 1 R G B Opa color 2 R G B Opa
EHP_Color = [Color.new(205, 255, 205, 200), Color.new(10, 220, 45, 200)]
# if you want to display grahics bar pictures fill this
NormalEne = "" # normal enemy hp bar
NormalBack = "" # Background semi-transparent bar
#=============================================================================
# * Enemy Boss HP Bar
#
# Boss enemies Bar x and y position on the screen
BeScreenPos_X = 100
BeScreenPos_Y = 286
#
# Dimentions of the bars you cant exceed 640 width x 100 height
# x y width height
BHP_BarDimentions = [8, 22, 330, 12]
#
# color 1 R G B Opa color 2 R G B Opa
BHP_Color = [Color.new(205, 255, 205, 200), Color.new(10, 220, 45, 200)]
# if you want to display grahics bar pictures fill this
BossEne = "" # Boss enemy Hp bar
BossBack = "" # Background semi-transparent bar
#=============================================================================
def self.show() $game_system.pearlbars = nil end
def self.hide() $game_system.pearlbars = true end
def self.enemy_auto(event_id)
$game_system.enemy_lifeobject = $game_map.events[event_id]
end
end
($imported ||= {})["Falcao Pearl ABS Life"] = true
class Spriteset_Map
alias falcaopearl_lifebars_create create_pictures
def create_pictures
create_hud_lifebars
falcaopearl_lifebars_create
end
def create_hud_lifebars
@enemy_lifeobject = $game_system.enemy_lifeobject
@enemyhpsp = Sprite_LifeBars.new(@viewport2, @enemy_lifeobject) if
not @enemy_lifeobject.nil?
end
def create_actorlifebars
return if !@actor_lifebar.nil?
@actor_lifebar = Sprite_LifeBars.new(@viewport2, $game_player)
end
def dispose_actorlifebars
return if @actor_lifebar.nil?
@actor_lifebar.dispose
@actor_lifebar = nil
end
alias falcaopearl_lifebars_update update
def update
update_lifebars_sprites
falcaopearl_lifebars_update
end
def update_lifebars_sprites
$game_system.pearlbars.nil? ? create_actorlifebars : dispose_actorlifebars
@actor_lifebar.update unless @actor_lifebar.nil?
# enemy
if !@enemyhpsp.nil?
unless @enemyhpsp.disposed?
@enemyhpsp.update
else
@enemyhpsp.dispose
@enemyhpsp = nil
$game_system.enemy_lifeobject = nil
@enemy_lifeobject = nil
end
end
if @enemy_lifeobject != $game_system.enemy_lifeobject
@enemyhpsp.dispose if !@enemyhpsp.nil?
@enemyhpsp = nil
@enemyhpsp = Sprite_LifeBars.new(@viewport2,$game_system.enemy_lifeobject)
@enemy_lifeobject = $game_system.enemy_lifeobject
end
end
alias falcaopearl_lifebars_dispose dispose
def dispose
dispose_actorlifebars
@enemyhpsp.dispose unless @enemyhpsp.nil?
falcaopearl_lifebars_dispose
end
end
# Life bars sprite
class Sprite_LifeBars < Sprite
include PearlBars
def initialize(viewport, character)
super(viewport)
@character = character
self.bitmap = Bitmap.new(boss? ? 640 : 300, 120)
@old_hp = battler.hp
@old_mp = battler.mp
@erasetimer = 180
@state_checker = []
@buff_checker = []
refresh_contents
@view = viewport
update
end
def boss?
return true if battler.is_a?(Game_Enemy) && battler.boss_hud
return false
end
def battler
return @character.battler
end
def refresh_contents
self.bitmap.clear
self.bitmap.font.size = 19
@erasetimer = 180
self.opacity = 255
if battler.is_a?(Game_Actor)
@old_exp = battler.exp
@old_tp = battler.tp
self.x = ScreenPos_X
self.y = ScreenPos_Y
h = HP_BarDimentions ; m = MP_BarDimentions ; e = EX_BarDimentions
if PearlBars::ActorsHp != ""
@pimg = Cache.picture(PearlBars::ActorsHp) if @pimg.nil?
@bimg = Cache.picture(PearlBars::ActorsBack) if @bimg.nil?
@pimp = Cache.picture(PearlBars::ActorsMp) if @pimp.nil?
PearlKernel.image_hp(self.bitmap, h[0] + 4, h[1],@bimg,
@pimg, battler,true)
PearlKernel.image_mp(self.bitmap, m[0] + 4, m[1], @bimg, @pimp, battler)
if PearlBars::ActorsExp != ""
@piexp = Cache.picture(PearlBars::ActorsExp) if @piexp.nil?
PearlKernel.image_exp(self.bitmap,e[0] + 4,e[1],@bimg,@piexp, battler)
end
else
hc = HP_Color ; mc = MP_Color ; ec = EX_Color
PearlKernel.draw_hp(self.bitmap,battler, h[0], h[1], h[2], h[3], hc)
PearlKernel.draw_mp(self.bitmap,battler, m[0], m[1], m[2], m[3], mc)
PearlKernel.draw_exp(self.bitmap,battler, e[0], e[1], e[2], e[3], ec)
end
PearlKernel.draw_tp(self.bitmap, TP_Info[0], TP_Info[1], battler)
else battler.is_a?(Game_Enemy)
if boss?
self.x = BeScreenPos_X
self.y = BeScreenPos_Y
h = BHP_BarDimentions ; hc = BHP_Color
if PearlBars::BossEne != ""
@n_img = Cache.picture(PearlBars::BossEne) if @n_img.nil?
@n_back = Cache.picture(PearlBars::BossBack) if @n_back.nil?
PearlKernel.image_hp(self.bitmap, h[0] + 4, h[1],@n_back,
@n_img, battler,true)
else
PearlKernel.draw_hp(self.bitmap,battler, h[0],h[1],h[2], h[3],hc,true)
end
else
self.x = NeScreenPos_X
self.y = NeScreenPos_Y
h = EHP_BarDimentions ; hc = EHP_Color
if PearlBars::NormalEne != ""
@n_img = Cache.picture(PearlBars::NormalEne) if @n_img.nil?
@n_back = Cache.picture(PearlBars::NormalBack) if @n_back.nil?
PearlKernel.image_hp(self.bitmap, h[0] + 4, h[1],@n_back,
@n_img, battler,true)
else
PearlKernel.draw_hp(self.bitmap,battler,h[0],h[1],h[2], h[3], hc,true)
end
end
end
end
def update
super
if @old_hp != battler.hp
refresh_contents
@old_hp = battler.hp
end
if @old_mp != battler.mp
refresh_contents
@character.actor.apply_usability if @character.is_a?(Game_Player)
@old_mp = battler.mp
end
if battler.is_a?(Game_Actor)
if @old_exp != battler.exp
@old_exp = battler.exp
refresh_contents
end
if @old_tp != battler.tp
@old_tp = battler.tp
@character.actor.apply_usability if @character.is_a?(Game_Player)
refresh_contents
end
elsif battler.is_a?(Game_Enemy)
if boss?
dispose if battler.dead?
else
if @erasetimer > 0
@erasetimer -= 1
self.opacity -= 10 if @erasetimer <= 25
@states.opacity = self.opacity if !@states.nil?
dispose if @erasetimer == 0
end
end
update_enemy_status_icons
end
end
# enemy status icons engine
def update_enemy_status_icons
display_status? ? create_states_icons : dispose_state_icons
4.times.each {|i| refresh_states_icons if
@state_checker[i] != battler.state_icons[i]}
2.times.each {|i| refresh_states_icons if
@buff_checker[i] != battler.buff_icons[i]}
end
def display_status?
return true if !battler.state_icons.empty?
return true if !battler.buff_icons.empty?
return false
end
def create_states_icons
return if disposed?
return if !@states.nil?
@states = ::Sprite.new(@view)
@states.bitmap = Bitmap.new(144, 24)
@n_back.nil? ? y_plus = BHP_BarDimentions[3] : y_plus = @n_back.height
pos = [BeScreenPos_X, BeScreenPos_Y, y_plus] if boss?
pos = [NeScreenPos_X, NeScreenPos_Y, y_plus] if !boss?
@states.x = pos[0] + 10
@states.y = pos[1] + pos[2] + 24
@states.zoom_x = 0.8
@states.zoom_y = 0.8
refresh_states_icons
end
def dispose_state_icons
return if @states.nil?
@states.bitmap.dispose
@states.dispose
@states = nil
end
def refresh_states_icons
4.times.each {|i| @state_checker[i] = battler.state_icons[i]}
2.times.each {|i| @buff_checker[i] = battler.buff_icons[i]}
return if @states.nil?
@states.bitmap.clear
x = 0
battler.state_icons.each {|icon| draw_icon(icon, x, 0) ; x += 24
break if x == 96}
count = 0
battler.buff_icons.each {|icon| draw_icon(icon, x, 0) ; x += 24 ; count += 1
break if count == 2}
end
def draw_icon(icon_index, x, y, enabled = true)
bit = Cache.system("Iconset")
rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
@states.bitmap.blt(x, y, bit, rect, enabled ? 255 : 150)
end
def dispose
self.bitmap.dispose
dispose_state_icons
super
end
end
# Make the enemy bars to load when enemy is hited
class Projectile < Game_Character
alias falcao_lifebars_execute execute_damageto_enemy
def execute_damageto_enemy(event)
$game_system.enemy_lifeobject = event if @user.is_a?(Game_Player) &&
!event.battler.object
falcao_lifebars_execute(event)
end
end
Pearl Item pop up
Hier sollte auch irgendwo ein Bild aufgerufen werden. So genau habe ich mir den Code noch nicht angeschaut.
#===============================================================================
# * Falcao Pearl ABS script shelf # 8
#
# Item and gold pop up v 1.0
# This is just an add on for the Pearl ABS system, it run as standalone mode too
#
# Website: http://falcaorgss.wordpress.com/
# Foro: www.makerpalace.com
#===============================================================================
#
# * Installation
# This work as plug and play, copy and paste the script above main
#
# * Usage
# There is no special references, when you earn an item or gold, then pop appear
# Edit the module below for convenience
#-------------------------------------------------------------------------------
module PearlItemPop
# Position X of the pop up object
Pos_X = 10
# Position Y of the pop up object
Pos_Y = 320
# Icon displayed when earnig gold
GoldIcon = 245
# Se sound played when gaining items (set nil if you dont want to play sound)
ItemSe = "Item3"
# Se sound played when gainig gold (set nil if you dont want to play sound)
GoldSe = "Shop"
end
class Game_Party < Game_Unit
alias falcaopearl_itempop_gain gain_item
def gain_item(item, amount, include_equip = false)
if !item_container(item.class).nil? && SceneManager.scene_is?(Scene_Map)
if amount > 0
$game_system.item_object = [item, amount]
RPG::SE.new(PearlItemPop::ItemSe, 80).play rescue nil
end
end
falcaopearl_itempop_gain(item, amount, include_equip = false)
end
alias falcaopearl_itempop_gold gain_gold
def gain_gold(amount)
if SceneManager.scene_is?(Scene_Map)
$game_system.item_object = [nil, amount]
RPG::SE.new(PearlItemPop::GoldSe, 80).play rescue nil
end
falcaopearl_itempop_gold(amount)
end
end
class Game_System
attr_accessor :item_object
end
class Spriteset_Map
alias falcaopearl_itempop_create create_pictures
def create_pictures
create_itempop_sprites
falcaopearl_itempop_create
end
def create_itempop_sprites
@item_object = $game_system.item_object
@item_sprite = Sprite_PopItem.new(@viewport2, @item_object) if
not @item_object.nil?
end
alias falcaopearl_itempop_update update
def update
if !@item_sprite.nil?
unless @item_sprite.disposed?
@item_sprite.update
else
@item_sprite.dispose
@item_object = nil
$game_system.item_object = nil
@item_sprite = nil
end
end
if @item_object != $game_system.item_object
@item_sprite.dispose if !@item_sprite.nil?
@item_sprite = nil
@item_sprite = Sprite_PopItem.new(@viewport2, $game_system.item_object)
@item_object = $game_system.item_object
end
falcaopearl_itempop_update
end
alias falcaopearl_itempop_dispose dispose
def dispose
@item_sprite.dispose unless @item_sprite.nil?
falcaopearl_itempop_dispose
end
end
class Sprite_PopItem < Sprite
def initialize(viewport, item)
super(viewport)
@item = item[0]
@num = item[1]
set_bitmap
self.x = PearlItemPop::Pos_X
self.y = PearlItemPop::Pos_Y
@erasetimer = 120
update
end
def update
super
if @erasetimer > 0
@erasetimer -= 1
self.opacity -= 10 if @erasetimer <= 25
dispose if @erasetimer == 0
end
end
def dispose
self.bitmap.dispose
super
end
def set_bitmap
@item.nil? ? operand = Vocab::currency_unit : operand = @item.name
string = operand + ' X' + @num.to_s
self.bitmap = Bitmap.new(26 + string.length * 9, 28)
self.bitmap.fill_rect(0, 0, self.bitmap.width, 28, Color.new(0, 0, 0, 100))
self.bitmap.font.size = 20
bitmap = Cache.system("Iconset")
icon = @item.nil? ? PearlItemPop::GoldIcon : @item.icon_index
rect = Rect.new(icon % 16 * 24, icon / 16 * 24, 24, 24)
self.bitmap.blt(4, 0, bitmap, rect)
self.bitmap.draw_text(28, 0, 250, 32, string)
end
end
Falcao Pearl ABS script
Hier bin ich mir offen gestanden nicht sicher ob irgendwo Bilder oder Icons mit angezeigt werden.
#===============================================================================
# * Falcao Pearl ABS script shelf # 6
#
# This script handles all scenes related in pearl ABS
#===============================================================================
module PearlScenes
# Cursor icon displayed when selecting a target
CursorIcon = 389
# Status text displayed in the player selection menu
DeathStatus = 'Death' # Displayed when death
BadStatus = 'Bad' # Displayed when 0 to 25% of hp
OverageStatus = 'Overage' # Displayed when 25 to 50% of hp
GoodStatus = 'Good' # Displayed when 50 to 75% of hp
ExellentStatus = 'Exellent' # Displayed when 75 to 100% of hp
end
#===============================================================================
# target slection engine
class Window_EventSelect < Window_Selectable
attr_reader :participants
def initialize(object)
super(0, 0, 150, 192)
self.z = 101
@participants = []
refresh(object)
self.index = 0
self.visible = false
activate
end
def item
return @data[self.index]
end
def refresh(object)
self.contents.clear if self.contents != nil
@data = []
for character in object
if character.is_a?(Game_Event)
if character.on_battle_screen? and character.enemy_ready?
@data.push(character)
character.target_index = @data.size - 1
@participants.push(character)
end
elsif character.on_battle_screen?
next if character.battler.deadposing != nil and
$game_map.map_id != character.battler.deadposing
@data.push(character)
character.target_index = @data.size - 1
@participants.push(character)
end
end
@item_max = @data.size
if @item_max > 0
self.contents = Bitmap.new(width - 32, row_max * 26)
for i in 0...@item_max
draw_item(i)
end
end
end
def draw_item(index)
item = @data[index]
x, y = index % col_max * (120 + 32), index / col_max * 24
self.contents.font.size = 16
self.contents.draw_text(x + 24, y, 212, 32, 'none', 0)
end
def item_max
return @item_max.nil? ? 0 : @item_max
end
end
# Scenen events selection target
class Scene_BattlerSelection < Scene_MenuBase
def start
super
@mouse_exist = defined?(Map_Buttons).is_a?(String)
item = $game_player.targeting[1]
if item.is_a?(RPG::Skill) || item.is_a?(RPG::Item)
load_target(item)
else
invoke = item.tool_data("Tool Invoke Skill = ")
if invoke != 0
load_target($data_skills[invoke])
else
@event_window = Window_EventSelect.new($game_map.events.values)
end
end
# info window
@info_window = Sprite.new
@event_window.item.nil? ? t = 'No targets!' : t = 'Select target'
@info_window.bitmap = Bitmap.new(300, 60)
@info_window.z = 900
x, y = Graphics.width / 2 - 300 / 2, Graphics.height / 2 - 60 / 2
@info_window.x = x; @info_window.y = y
@info_window.bitmap.font.size = 30
@info_window.bitmap.font.shadow = true
@info_window.bitmap.draw_text(0, 0, @info_window.width, 32, t, 1)
@info_time = 60
create_cursor unless @event_window.item.nil?
@background_sprite.color.set(16, 16, 16, 70)
end
def create_name_sprites
return if !@name_text.nil?
@name_text = Sprite.new
@name_text.bitmap = Bitmap.new(200, 60)
@name_text.bitmap.font.size = 20
@name_text.bitmap.font.shadow = true
@name_text.x = @event_window.item.screen_x - 100
@name_text.y = @event_window.item.screen_y - 58
text = @event_window.item.battler.name
@name_text.bitmap.draw_text(0, 0, @name_text.width, 32, text, 1)
end
def dispose_name_sprites
return if @name_text.nil?
@name_text.bitmap.dispose
@name_text.dispose
@name_text = nil
end
# load item target
def load_target(item)
if item.scope.between?(1, 6)
@event_window = Window_EventSelect.new($game_map.events.values)
else
targets = []
$game_player.followers.each {|i| targets << i if i.visible?}
targets << $game_player
@event_window = Window_EventSelect.new(targets)
end
end
def refresh_info(type)
@info_window.bitmap.clear
t = 'Invalid Target!' if type == 2
@info_window.bitmap.draw_text(-30, 0, @info_window.width, 32, t, 1)
end
def create_cursor
if @mouse_exist
@cursor = $mouse_cursor
@cursor_zooming = 0 ; update_cursor_position
return
end
@cursor = Sprite.new
icon = PearlScenes::CursorIcon
@cursor.bitmap = Bitmap.new(24, 24)
bitmap = Cache.system("Iconset")
rect = Rect.new(icon % 16 * 24, icon / 16 * 24, 24, 24)
@cursor.bitmap.blt(0, 0, bitmap, rect)
@cursor_zooming = 0
update_cursor_position
end
def update
super
if Input.trigger?(:B)
$game_player.targeting = [false, item=nil, char=nil]
SceneManager.return
Sound.play_cancel
end
@info_time -= 1 if @info_time > 0
if @info_time == 0
@info_window.opacity -= 8 if @info_window.opacity > 0
if @info_window.opacity == 0 and @event_window.item.nil?
Sound.play_cancel
$game_player.targeting = [false, item=nil, char=nil]
SceneManager.return
end
end
return if @event_window.item.nil?
if @mouse_exist
for target in @event_window.participants
if Mouse.map_grid[0] == target.x and Mouse.map_grid[1] == target.y
@event_window.select(target.target_index)
end
end
end
if @current_index != @event_window.index
@current_index = @event_window.index
dispose_name_sprites
create_name_sprites
end
update_cursor_position
update_target_selection
end
# target selection
def update_target_selection
if Input.trigger?(:C)
if @mouse_exist
for event in @event_window.participants
if Mouse.map_grid[0] == event.x and Mouse.map_grid[1] == event.y
@event_window.select(event.target_index)
@selected = true
end
end
if @selected.nil?
refresh_info(2)
@info_time = 60; @info_window.opacity = 255
Sound.play_buzzer
return
end
end
Sound.play_ok
$game_player.targeting[2] = @event_window.item
SceneManager.return
end
end
def update_cursor_position
if @mouse_exist
@cursor.x = Mouse.pos[0]
@cursor.y = Mouse.pos[1]
else
@cursor.x = @event_window.item.screen_x
@cursor.y = @event_window.item.screen_y - 16
end
@cursor_zooming += 1
case @cursor_zooming
when 1..10 ; @cursor.zoom_x -= 0.01 ; @cursor.zoom_y -= 0.01
when 11..20; @cursor.zoom_x += 0.01 ; @cursor.zoom_y += 0.01
when 21..30; @cursor.zoom_x = 1.0 ; @cursor.zoom_y = 1.0
@cursor_zooming = 0
end
end
def terminate
super
@event_window.dispose
@info_window.dispose
@info_window.bitmap.dispose
dispose_name_sprites
if @mouse_exist and !@cursor.nil?
@cursor.zoom_x = 1.0 ; @cursor.zoom_y = 1.0 ; @selected = nil
else
@cursor.dispose unless @cursor.nil?
@cursor.bitmap.dispose unless @cursor.nil?
end
end
end
#===============================================================================
#===============================================================================
# * Player slection engine
# Primary use selection
class Window_Primaryuse < Window_Command
attr_accessor :actor
def initialize(x, y, actor)
@actor = actor
super(x, y)
deactivate ; unselect
end
def window_width() return 544 end
def window_height() return 80 end
def make_command_list
add_command('Weapon ' + Key::Weapon[1], 'Weapon ' + Key::Weapon[1])
add_command('Armor ' + Key::Armor[1], 'Armor ' + Key::Armor[1])
add_command('Item ' + Key::Item[1], 'Item ' + Key::Item[1])
add_command('Item ' + Key::Item2[1], 'Item ' + Key::Item2[1])
add_command('Skill ' + Key::Skill[1], 'Skill ' + Key::Skill[1])
add_command('Skill ' + Key::Skill2[1], 'Skill ' + Key::Skill2[1])
add_command('Skill ' + Key::Skill3[1], 'Skill ' + Key::Skill3[1])
add_command('Skill ' + Key::Skill4[1], 'Skill ' + Key::Skill4[1])
end
def refresh_actor(actor)
@actor = actor
refresh
end
def col_max
return 4
end
def draw_item(index)
contents.font.size = 20
if @actor.primary_use == index + 1
contents.font.color = Color.new(255, 120, 0, 255)
draw_text(item_rect_for_text(index), command_name(index), alignment)
change_color(normal_color, command_enabled?(index))
return
end
super
end
end
class Window_CharacterSet < Window_Selectable
include PearlScenes
def initialize(x=0, y=0)
super(x, y, 544, 156)
refresh
self.index = 0
activate
end
def item
return @data[self.index]
end
def refresh
self.contents.clear if self.contents != nil
@data = []
$game_party.battle_members.each {|actor| @data.push(actor)}
@item_max = @data.size
if @item_max > 0
self.contents = Bitmap.new(width - 26, row_max * 128)
for i in 0...@item_max
draw_item(i)
end
end
end
def draw_item(index)
item = @data[index]
x, y = index % col_max * (138), index / col_max * 130
self.contents.font.size = 20
contents.fill_rect(x, y, item_width, item_height, Color.new(0, 0, 0, 60))
draw_character(item.character_name, item.character_index, x + 22, y + 56)
hp_color = [Color.new(205, 255, 205, 200), Color.new(10, 220, 45, 200)]
mp_color = [Color.new(180, 225, 245, 200), Color.new(20, 160, 225, 200)]
PearlKernel.draw_hp(self.contents, item, x + 4, y + 66, 96, 12, hp_color)
PearlKernel.draw_mp(self.contents, item, x + 4, y + 86, 96, 12, mp_color)
contents.draw_text(x - 2, y, item_width, 32, item.name, 2)
contents.draw_text(x - 2, y + 20, item_width, 32, item.class.name, 2)
case (item.hp.to_f / item.mhp.to_f * 100.0)
when 0 ; text = DeathStatus
when 1..25 ; text = BadStatus
when 26..50 ; text = OverageStatus
when 51..75 ; text = GoodStatus
when 76..100 ; text = ExellentStatus
end
if item.state?(1)
draw_icon($data_states[1].icon_index, x + 50, y + 100)
end
contents.draw_text(x + 4, y + 100, item_width, 32, text) rescue nil
end
def item_max
return @item_max.nil? ? 0 : @item_max
end
def col_max
return 4
end
def line_height
return 130
end
end
class Scene_CharacterSet < Scene_MenuBase
def start
super
x, y = Graphics.width / 2 - 544 / 2, Graphics.height / 2 - 60 / 2
@top_text = Window_Base.new(x, y - 170, 544, 60)
@top_text.draw_text(0, 0, @top_text.width, 32, 'Select your Player', 1)
@window_charset = Window_CharacterSet.new(@top_text.x, @top_text.y + 60)
@primary_info = Window_Base.new(@top_text.x,@window_charset.y + 156, 544,60)
@timer = 0
refresh_primary_info('Press A to set up')
@primary_use = Window_Primaryuse.new(@top_text.x,@primary_info.y + 60,actor)
@primary_use.set_handler('Weapon ' + Key::Weapon[1], method(:apply_item))
@primary_use.set_handler('Armor ' + Key::Armor[1], method(:apply_item))
@primary_use.set_handler('Item ' + Key::Item[1], method(:apply_item))
@primary_use.set_handler('Item ' + Key::Item2[1], method(:apply_item))
@primary_use.set_handler('Skill ' + Key::Skill[1], method(:apply_item))
@primary_use.set_handler('Skill ' + Key::Skill2[1], method(:apply_item))
@primary_use.set_handler('Skill ' + Key::Skill3[1], method(:apply_item))
@primary_use.set_handler('Skill ' + Key::Skill4[1], method(:apply_item))
DisplayTools.create(@primary_use.x + 94, @primary_use.y + 85)
if $game_player.in_combat_mode?
$game_temp.pop_w(180, 'Pearl ABS',
'You cannot switch player while in combat!')
end
@index_char = @window_charset.index
@background_sprite.color.set(16, 16, 16, 70)
end
def apply_item
case @primary_use.current_symbol
when 'Weapon ' + Key::Weapon[1] then actor.primary_use = 1
when 'Armor ' + Key::Armor[1] then actor.primary_use = 2
when 'Item ' + Key::Item[1] then actor.primary_use = 3
when 'Item ' + Key::Item2[1] then actor.primary_use = 4
when 'Skill ' + Key::Skill[1] then actor.primary_use = 5
when 'Skill ' + Key::Skill2[1] then actor.primary_use = 6
when 'Skill ' + Key::Skill3[1] then actor.primary_use = 7
when 'Skill ' + Key::Skill4[1] then actor.primary_use = 8
end
refresh_primary_info(actor.name+ " now use #{@primary_use.current_symbol}!")
@primary_use.refresh_actor(actor)
cancel_setup; @timer = 120
end
def actor
@window_charset.item
end
def refresh_primary_info(text)
@primary_info.contents.clear
@primary_info.contents.font.size = 20
@primary_info.draw_text(0, 0, 544, 32, 'As a follower primarily use tool?')
@primary_info.draw_text(-26, 0, 544, 32, text, 2)
end
def update
super
if $game_player.in_combat_mode?
SceneManager.return if $game_temp.pop_windowdata[0] == 4
return
end
if @timer > 0
@timer -= 1
refresh_primary_info('Press A to set up') if @timer == 0
end
DisplayTools.update
if @index_char != @window_charset.index
@index_char = @window_charset.index
DisplayTools.sprite.actor = actor
DisplayTools.sprite.refresh_icons
DisplayTools.sprite.refresh_texts
@primary_use.refresh_actor(actor)
end
update_cancel if Input.trigger?(:B)
update_player_selection if Input.trigger?(:C)
update_setup if Input.trigger?(:X)
end
def update_setup
return if @primary_use.active
Sound.play_ok
@window_charset.deactivate
@primary_use.activate
@primary_use.select(0)
end
def cancel_setup
@window_charset.activate
@primary_use.deactivate
@primary_use.unselect
end
def update_cancel
Sound.play_cancel
if @window_charset.active
if $game_player.actor.dead?
Sound.play_buzzer
return
end
SceneManager.return
else
cancel_setup
end
end
def update_player_selection
if @window_charset.active
if @window_charset.item.dead?
Sound.play_buzzer
return
end
Sound.play_ok
$game_party.swap_order(0, @window_charset.index)
SceneManager.return
end
end
def terminate
super
@window_charset.dispose
@top_text.dispose
@primary_use.dispose
@primary_info.dispose
DisplayTools.dispose
end
end
#===============================================================================
#===============================================================================
# * Quick tool se3lection engine
class Window_Base < Window
def draw_text_ex2(x, y, text)
text = convert_escape_characters(text)
pos = {:x => x, :y => y, :new_x => x, :height => calc_line_height(text)}
process_character(text.slice!(0, 1), text, pos) until text.empty?
end
end
# window horizon
class Window_ItemSelect < Window_HorzCommand
def initialize(x=0, y=0)
super(x, y)
end
def window_width() return 460 end
def window_height() return 50 end
def make_command_list
add_command("Weapons", :weapon)
add_command("Left Hand", :armor)
add_command("Items", :item)
add_command("Skills", :skill)
end
def draw_item(index)
contents.font.size = 20
super
end
end
# window slot ask
class Window_SlotConfirm < Window_Command
def initialize(x, y, kind)
@kind = kind
super(x, y)
activate
end
def window_width() return 130 end
def window_height() return @kind == :item ? 80 : 120 end
def make_command_list
case @kind
when :item
add_command('Slot ' + Key::Item[1], :slot1)
add_command('Slot ' + Key::Item2[1], :slot2)
when :skill
add_command('Slot ' + Key::Skill[1], :slot1)
add_command('Slot ' + Key::Skill2[1], :slot2)
add_command('Slot ' + Key::Skill3[1], :slot3)
add_command('Slot ' + Key::Skill4[1], :slot4)
end
end
def draw_item(index)
contents.font.size = 20
super
end
end
# Actor quick tool
class Window_ActorQuickTool < Window_Selectable
def initialize(x=0, y=124, w=460, h=148)
super(x, y, w, h)
unselect
end
def item() return @data[self.index] end
def col_max() return 2 end
def spacing() return 6 end
def refresh(actor, kind)
self.contents.clear if self.contents != nil
@data = []
if kind == :weapon
operand = $game_party.weapons
operand.push(actor.equips[0]) if actor.equips[0] != nil
end
if kind == :armor
operand = $game_party.armors
operand.push(actor.equips[1]) if actor.equips[1] != nil
end
operand = $game_party.items if kind == :item
operand = actor.skills if kind == :skill
for item in operand
if kind == :weapon || kind == :armor
next unless actor.equippable?(item)
next if item.etype_id > 1
end
@data.push(item) unless @data.include?(item)
end
@item_max = @data.size
if @item_max > 0
self.contents = Bitmap.new(width - 32, row_max * 24)
for i in 0...@item_max
draw_item(i)
end
end
end
def draw_item(index)
item = @data[index]
x, y = index % col_max * (190 + 32), index / col_max * 24
self.contents.font.size = 20
draw_icon(item.icon_index, x, y)
contents.draw_text(x + 24, y, 212, 32, item.name)
end
def item_max
return @item_max.nil? ? 0 : @item_max
end
end
module DisplayTools
def self.create(x, y)
@viewport2 = Viewport.new ; @viewport2.z = 999
@pearl_tool_sprite = Sprite_PearlTool.new(@viewport2, [x, y])
end
def self.sprite
return @pearl_tool_sprite
end
def self.update
@pearl_tool_sprite.update
end
def self.dispose
@pearl_tool_sprite.dispose ; @viewport2.dispose
@viewport2 = nil ; @pearl_tool_sprite = nil
end
end
# Scene quick tool
class Scene_QuickTool < Scene_MenuBase
def start
super
x, y = Graphics.width / 2 - 460 / 2, Graphics.height / 2 - 85 / 2
@top_text = Window_Base.new(x, y - 156, 460, 85)
@statust = ['Ready', 0]
refresh_top_info
@type_select = Window_ItemSelect.new(@top_text.x, @top_text.y + 85)
@type_select.set_handler(:weapon, method(:refresh_tools))
@type_select.set_handler(:armor, method(:refresh_tools))
@type_select.set_handler(:item, method(:refresh_tools))
@type_select.set_handler(:skill, method(:refresh_tools))
@type_select.set_handler(:cancel, method(:refresh_cancel))
@type_index = @type_select.index
@items_w = Window_ActorQuickTool.new(@type_select.x, @type_select.y + 50)
@items_w.refresh($game_player.actor, @type_select.current_symbol)
@description = Window_Base.new(@items_w.x, @items_w.y + 148, 460, 75)
DisplayTools.create(@description.x + 75, @description.y + 80)
@background_sprite.color.set(16, 16, 16, 70)
end
# create slot confirm
def create_slot_confirm
@slot_confirm = Window_SlotConfirm.new(@items_w.x + 144, @items_w.y + 36,
@type_select.current_symbol)
if @type_select.current_symbol == :item
@slot_confirm.set_handler(:slot1, method(:open_slots))
@slot_confirm.set_handler(:slot2, method(:open_slots))
else
@slot_confirm.set_handler(:slot1, method(:open_slots))
@slot_confirm.set_handler(:slot2, method(:open_slots))
@slot_confirm.set_handler(:slot3, method(:open_slots))
@slot_confirm.set_handler(:slot4, method(:open_slots))
end
end
# dispose slot confirm
def dispose_slot_confirm
return if @slot_confirm.nil?
@slot_confirm.dispose
@slot_confirm = nil
end
# top info
def refresh_top_info
@top_text.contents.clear
@top_text.contents.font.size = 20
@top_text.contents.fill_rect(0, 0, 58, 74, Color.new(0, 0, 0, 60))
@top_text.draw_character(actor.character_name,actor.character_index, 26, 60)
@top_text.draw_text(62, 0, @top_text.width, 32, actor.name + ' Equippment')
@top_text.draw_text(62, 22, @top_text.width, 32, actor.class.name)
@top_text.draw_text(-22, 30, @top_text.width, 32, @statust[0], 2)
@top_text.draw_text(-22, 0,@top_text.width,32, 'M = Switch Player',2) unless
PearlKernel::SinglePlayer
end
def refresh_tools
enable_items
end
def refresh_cancel
SceneManager.return
end
def enable_items
@items_w.activate
@items_w.select(0)
end
def refresh_description
@description.contents.clear
@desc_index = @items_w.index
return if @items_w.item.nil? || @items_w.index < 0
@description.contents.font.size = 20
@description.draw_text_ex2(0, -4, @items_w.item.description)
end
def update
super
perform_item_ok if Input.trigger?(:C)
perform_canceling if Input.trigger?(:B)
if PearlKey.trigger?(Key::PlayerSelect) and !PearlKernel::SinglePlayer
Sound.play_ok
SceneManager.call(Scene_CharacterSet)
end
DisplayTools.update
perform_refresh
end
def perform_item_ok
return if @items_w.item.nil?
case @type_select.current_symbol
when :weapon
actor.change_equip_by_id(0, @items_w.item.id)
equip_play
when :armor
actor.change_equip_by_id(1, @items_w.item.id)
equip_play
when :item
activate_slots
when :skill
activate_slots
end
DisplayTools.sprite.refresh_texts
end
def activate_slots
@items_w.deactivate
create_slot_confirm
Sound.play_ok
end
def deactivate_slots
@items_w.activate
dispose_slot_confirm
end
def actor
return $game_player.actor
end
def equip_play
Sound.play_equip
@statust[1] = 80
end
# open slots
def open_slots
if @type_select.current_symbol == :item
case @slot_confirm.current_symbol
when :slot1 then actor.assigned_item = @items_w.item
when :slot2 then actor.assigned_item2 = @items_w.item
end
else
case @slot_confirm.current_symbol
when :slot1 then actor.assigned_skill = @items_w.item
when :slot2 then actor.assigned_skill2 = @items_w.item
when :slot3 then actor.assigned_skill3 = @items_w.item
when :slot4 then actor.assigned_skill4 = @items_w.item
end
end
equip_play ; deactivate_slots
DisplayTools.sprite.refresh_texts
end
def perform_canceling
Sound.play_cancel
if @items_w.active
@items_w.deactivate
@items_w.unselect
@type_select.activate
else
deactivate_slots
end
end
def perform_refresh
if @type_index != @type_select.index
@type_index = @type_select.index
@items_w.refresh($game_player.actor, @type_select.current_symbol)
refresh_description
end
if @desc_index != @items_w.index
@desc_index = @items_w.index
refresh_description
end
if @statust[1] > 0
@statust[1] -= 1
if @statust[1] == 78
@statust[0] = @items_w.item.name + ' Equipped'
refresh_top_info
elsif @statust[1] == 0
@statust = ['Ready', 0]
refresh_top_info
end
end
end
def terminate
super
@top_text.dispose
@type_select.dispose
@items_w.dispose
@description.dispose
dispose_slot_confirm
DisplayTools.dispose
end
end
Falcao Pearl ABS script
Bilder/Icons werden hier an mehreren Stellen eingefügt.
Wo überall weiß ich nicht
#===============================================================================
# * Falcao Pearl ABS script shelf # 5
#
# This script handles all sprites of Pearl ABS engine
#===============================================================================
# Anime action enguine
class Anime_Obj < Game_Character
attr_accessor :draw_it, :destroy_it, :item, :user, :original_speed
attr_reader :custom_graphic
def initialize(user, item)
super()
PearlKernel.load_item(item)
@draw_it = false
@destroy_it = false
@item = item
@user = user
@custom_graphic = false
graphic = PearlKernel.user_graphic
if graphic.split(" ").include?('custom')
graphic = graphic.sub("custom ","")
@custom_graphic = true
user.transparent = true
user.using_custom_g = true
end
@character_name = graphic
moveto(@user.x, @user.y)
set_direction(@user.direction)
@original_speed = PearlKernel.user_animespeed
end
end
# Sprite character added battlers as enemies and the anime sprites fit
class Sprite_Character < Sprite_Base
alias falcaopearl_update_position update_position
def update_position
if !@character.battler.nil? and @character.battler.is_a?(
Game_Enemy) and @character.battler.breath_enable
apply_breath_effect(@character)
end
self.zoom_x = @character.zoomfx_x
self.zoom_y = @character.zoomfx_y
self.angle = @character.angle_fx
falcaopearl_update_position
update_anime_object_pos
end
# anime object position and action
def update_anime_object_pos
if @character.is_a?(Anime_Obj)
if @character.custom_graphic
add = 0
else
@ch == 128 ? add = 48 : add = (@ch / 2) / 2
end
self.x = @character.user.screen_x
self.y = @character.user.screen_y + add
self.z = @character.user.screen_z + 1
@character.direction = @character.user.direction
if @character.user.anime_speed == 0
if @character.custom_graphic
@character.user.transparent = false
@character.user.using_custom_g = false
end
@character.destroy_it = true
end
if @character.user.making_spiral
@character.direction == 8 ? @character.pattern=1 : @character.pattern=2
return
end
a= @character.user.anime_speed.to_f/@character.original_speed.to_f * 100.0
case a
when 80..100 ; @character.pattern = 0
when 60..80 ; @character.pattern = 1
when 25..60 ; @character.pattern = 2
end
end
end
# Enemy battler graphics engine
alias falcaopearl_battler_bitmap set_character_bitmap
def set_character_bitmap
if battler_graphic?
self.bitmap= Cache.battler(@character_name,@character.battler.battler_hue)
self.ox = self.bitmap.width / 2
self.oy = self.bitmap.height
return
end
falcaopearl_battler_bitmap
end
def battler_graphic?
if !@character.battler.nil? and @character.battler.is_a?(
Game_Enemy) and @character.battler.battler_graphic
return false if @character.page.nil?
@character_name = @character.battler.battler_name
return true
end
return false
end
alias falcaopearl_battler_graphic update_src_rect
def update_src_rect
return if battler_graphic?
falcaopearl_battler_graphic
end
# breath effect
def apply_breath_effect(char)
return if @character.is_a?(Game_Event) and @character.erased
char.zoomfx_x -= 0.0023 if !char.zfx_bol
char.zoomfx_y -= 0.0023 if !char.zfx_bol
char.zoomfx_x += 0.0023 if char.zfx_bol
char.zoomfx_y += 0.0023 if char.zfx_bol
char.zfx_bol = true if char.zoomfx_x <= 0.93
char.zfx_bol = false if char.zoomfx_x >= 1.0
end
end
#===============================================================================
# Drop sprites
class Sprite_EnemyDrop < Sprite
attr_reader :event
def initialize(viewport, event, item)
super(viewport)
@event = event
@item = item
self.z = $game_player.screen_z - 1
@object_zooming = 0
set_bitmap
update
end
def update
super
self.bush_depth = @event.bush_depth
@object_zooming += 1
case @object_zooming
when 1..8 ; self.zoom_x -= 0.01 ; self.zoom_y -= 0.01
when 9..16 ; self.zoom_x += 0.01 ; self.zoom_y += 0.01
when 17..24 ; self.zoom_x = 1.0 ; self.zoom_y = 1.0; @object_zooming = 0
end
self.x = @event.screen_x - 12
self.y = @event.screen_y - 24
if @event.x == $game_player.x and @event.y == $game_player.y and
!$game_player.moving?
$game_party.gain_item(@item, 1)
dispose
@event.dropped_items.delete(@item)
$game_map.events_withtags.delete(@event)
end
end
def dispose
self.bitmap.dispose
super
end
def set_bitmap
self.bitmap = Bitmap.new(26, 38)
bitmap = Cache.system("Iconset")
icon = @item.icon_index
rect = Rect.new(icon % 16 * 24, icon / 16 * 24, 24, 24)
self.bitmap.blt(0, 0, bitmap, rect)
end
end
#===============================================================================
# Dead icon sprites for player and followers
class Sprite_DeadIcon < Sprite
attr_reader :character
def initialize(viewport, character)
super(viewport)
@character = character
self.bitmap = Bitmap.new(24, 24)
bitmap = Cache.system("Iconset")
icon = 1
rect = Rect.new(icon % 16 * 24, icon / 16 * 24, 24, 24)
self.bitmap.blt(0, 0, bitmap, rect)
@knok = @character.actor.actor.tool_data("Knockdown Graphic = ",false)!= nil
update
end
def update
super
self.x = @character.screen_x - 10
self.y = @character.screen_y - 54
self.z = @character.screen_z + 1
self.opacity = @character.opacity
self.visible = !@character.transparent
if @knok
@character.knockdown_data[0] = 10 if !@character.battler.deadposing.nil?
else
@character.playdead
@character.direction = 8
self.x = @character.screen_x - 26
end
end
def dispose
self.bitmap.dispose
@character.angle_fx = 0.0 unless @knok
super
end
end
#===============================================================================
# State and buff icons sprites
class StateBuffIcons < Sprite
def initialize(viewport, mode)
super(viewport)
@mode = mode
self.bitmap = Bitmap.new(36, 134)
@picture = Cache.system("Iconset")
if @mode == "States"
self.x = 544 - 36
self.y = 90
else
self.x = 544 - 36
self.y = 230
end
@actor = $game_player.actor
@old_status = []
refresh_icons
update
end
def icons
return @actor.state_icons if @mode == 'States'
return @actor.buff_icons if @mode == 'Buffs'
end
def update
5.times.each {|i|
if @old_status[i] != icons[i]
refresh_icons
$game_player.actor.apply_usability
end}
if @actor != $game_player.actor
@actor = $game_player.actor
refresh_icons
end
end
def dispose
self.bitmap.dispose
super
end
def refresh_icons
self.bitmap.clear
self.bitmap.font.size = 15
self.bitmap.draw_text(-2, -8, self.bitmap.width + 6, 32, @mode, 1)
y = 12; count = 0
for i in icons
draw_icon(6, y, i)
y += 24; count += 1
break if count == 5
end
5.times.each {|i| @old_status[i] = icons[i]}
end
def draw_icon(x, y, index)
icon = index
rect = Rect.new(icon % 16 * 24, icon / 16 * 24, 24, 24)
self.bitmap.blt(x, y, @picture, rect)
end
end
#===============================================================================
# * Damage pop engine
class DamagePop_Obj < Game_Character
attr_accessor :draw_it, :destroy_it, :target, :dmgcustom, :timingg, :plus_time
attr_accessor :plus_time
def initialize(target, custom=nil)
super()
@draw_it = false
@destroy_it = false
@target = target
@timingg = 70
@plus_time = 0.0
@dmgcustom = custom
moveto(@target.x, @target.y)
end
end
class Sprite_DamagePop < Sprite
attr_reader :target
def initialize(viewport, target)
super(viewport)
@target = target
self.bitmap = Bitmap.new(200, 50)
self.bitmap.font.size = 20
case rand(4)
when 0 then @resto_plus = 0.5
when 1 then @resto_plus = 0.6
when 2 then @resto_plus = 0.7
when 3 then @resto_plus = 0.8
end
create_text_for_display
set_text
update
end
def create_text_for_display
battler = @target.target.battler
value = battler.result.hp_damage
value2 = battler.result.mp_damage
value3 = battler.result.tp_damage
# hp damage texts
if value > 0
battler.result.critical ? @text = 'Critical ' + value.to_s :
@text = value.to_s
elsif value < 0
self.bitmap.font.color = Color.new(10,220,45)
@text = value.to_s.sub("-","")
elsif battler.result.missed
@text = 'Miss'
elsif battler.result.evaded
@text = 'Evaded'
elsif battler.result.success # tanget take no damage but result succes
@text = value.to_s
end
# mp damage text
if value2 < 0
self.bitmap.font.color = Color.new(20,160,225)
@text = value2.to_s.sub("-","")
elsif value2 > 0
@text = 'Mp lose' + value2.to_s
end
# TP damage text
if value3 < 0
self.bitmap.font.color = Color.new(20,160,225)
@text = value3.to_s.sub("-","")
elsif value3 > 0
@text = 'Tp lose' + value3.to_s
end
# states and buff display
if battler.result.status_affected?
display_changed_states(battler)
display_changed_buffs(battler)
end
# Custom text (it has hightest priority
if !@target.dmgcustom.nil?
if @target.dmgcustom == 1
@text = 'Block ' + value.to_s
elsif @target.dmgcustom == 2
@text = 'Guard!'
elsif @target.dmgcustom.is_a?(String)
@text = @target.dmgcustom
elsif @target.dmgcustom.is_a?(Array)
self.bitmap.font.color = @target.dmgcustom[1]
@text = @target.dmgcustom[0]
end
end
battler.result.clear
end
# text set and position
def set_text
self.x = @target.screen_x - 98
self.y = @target.screen_y - 54
self.z = 3 * 100
self.opacity = @target.opacity
#self.bitmap.font.bold = true
self.bitmap.font.shadow = true
item = @target.target.battler.used_item
if item != nil and !item.scope.between?(1, 6) and
item.tool_data("User Graphic = ", false).nil?
@text = item.name if @text.nil?
end
@target.target.battler.used_item = nil
self.bitmap.draw_text(0, 0, 200, 32, @text, 1)
end
# Buffs display
def display_changed_buffs(target)
display_buffs(target, target.result.added_buffs, Vocab::BuffAdd)
display_buffs(target, target.result.added_debuffs, Vocab::DebuffAdd)
display_buffs(target, target.result.removed_buffs, Vocab::BuffRemove)
end
def display_buffs(target, buffs, fmt)
buffs.each do |param_id|
@text = sprintf(fmt,'', Vocab::param(param_id)).sub("'s","")
end
end
# States display
def display_changed_states(target)
display_added_states(target)
display_removed_states(target)
end
# Display added states
def display_added_states(target)
target.result.added_state_objects.each do |state|
state_msg = target.actor? ? state.message1 : state.message2
#target.perform_collapse_effect if state.id == target.death_state_id
next if state_msg.empty?
@text = state_msg
end
end
# Display removed states
def display_removed_states(target)
target.result.removed_state_objects.each do |state|
next if state.message4.empty?
@text = state.message4
end
end
def update
@target.timingg -= 1 if @target.timingg > 0
@target.plus_time += @resto_plus
self.opacity -= 5 if @target.timingg <= 25
@target.destroy_it = true if @target.timingg == 0
self.x = @target.target.screen_x - 98
self.y = @target.target.screen_y - 54 - @target.plus_time
end
def dispose
self.bitmap.dispose
super
end
end
#===============================================================================
# Sprite set map
class Spriteset_Map
alias falcaopearl_create_characters create_characters
def create_characters
create_pearl_abs_sprites
falcaopearl_create_characters
end
def create_pearl_abs_sprites
if $game_player.send_dispose_signal
dispose_pearlabs_sprites
$game_player.send_dispose_signal = false
end
@projectile_sprites = []
$game_player.projectiles.each do |projectile|
@projectile_sprites.push(Sprite_Character.new(@viewport1, projectile))
end
@damagepop_sprites = []
$game_player.damage_pop.each do |target|
@damagepop_sprites.push(Sprite_DamagePop.new(@viewport1, target))
end
@animeabs_sprites = []
$game_player.anime_action.each do |anime|
@animeabs_sprites.push(Sprite_Character.new(@viewport1, anime))
end
@enemy_drop_sprites = []
$game_player.enemy_drops.each do |enemy|
for i in enemy.dropped_items
@enemy_drop_sprites.push(Sprite_EnemyDrop.new(@viewport1, enemy, i))
end
end
@dead_iconsprites = []
@dead_characters = []
end
# Drop sprites update
def update_drop_sprites
@enemy_drop_sprites.each {|sprite| sprite.update if !sprite.disposed?
if sprite.disposed?
@enemy_drop_sprites.delete(sprite)
$game_player.enemy_drops.delete(sprite.event)
end
}
$game_player.enemy_drops.each do |enemy|
unless enemy.draw_drop
for i in enemy.dropped_items
@enemy_drop_sprites.push(Sprite_EnemyDrop.new(@viewport1, enemy, i))
end
enemy.draw_drop = true
end
end
end
alias falcaopearl_upsp_update update
def update
update_pearl_abs_main_sprites
falcaopearl_upsp_update
end
# pearl abs main sprites update
def update_pearl_abs_main_sprites
if $game_player.pearl_menu_call[1] == 1
dispose_tool_sprite
dispose_state_icons
dispose_buff_icons
dispose_actorlifebars if $imported["Falcao Pearl ABS Life"]
$game_player.pearl_menu_call[1] = 0
case $game_player.pearl_menu_call[0]
when :tools then SceneManager.call(Scene_QuickTool)
when :character then SceneManager.call(Scene_CharacterSet)
when :battler then SceneManager.call(Scene_BattlerSelection)
end
return
end
update_projectile_sprites
update_damagepop_sprites
update_absanime_sprites
update_dead_characters
update_drop_sprites
$game_system.skillbar_enable.nil? ? create_tool_sprite : dispose_tool_sprite
@pearl_tool_sprite.update unless @pearl_tool_sprite.nil?
$game_player.actor.state_icons.empty? ? dispose_state_icons :
create_state_icons
$game_player.actor.buff_icons.empty? ? dispose_buff_icons :
create_buff_icons
@states_sprites.update unless @states_sprites.nil?
@buff_sprites.update unless @buff_sprites.nil?
end
# create tool sprite
def create_tool_sprite
return if !@pearl_tool_sprite.nil?
@pearl_tool_sprite = Sprite_PearlTool.new(@viewport2)
end
# dispose tool sprite
def dispose_tool_sprite
return if @pearl_tool_sprite.nil?
@pearl_tool_sprite.dispose
@pearl_tool_sprite = nil
end
# Create State icons
def create_state_icons
return if !@states_sprites.nil?
@states_sprites = StateBuffIcons.new(@viewport2, 'States')
end
# dispose state icons
def dispose_state_icons
return if @states_sprites.nil?
@states_sprites.dispose
@states_sprites = nil
end
# Create Buff icons
def create_buff_icons
return if !@buff_sprites.nil?
@buff_sprites = StateBuffIcons.new(@viewport2, 'Buffs')
end
# dispose buff icons
def dispose_buff_icons
return if @buff_sprites.nil?
@buff_sprites.dispose
@buff_sprites = nil
end
# Projectiles
def update_projectile_sprites
@projectile_sprites.each {|sprite| sprite.update if !sprite.disposed?}
$game_player.projectiles.each do |projectile|
unless projectile.draw_it
@projectile_sprites.push(Sprite_Character.new(@viewport1, projectile))
projectile.draw_it = true
end
if projectile.destroy_it
@projectile_sprites.each {|i|
if i.character.is_a?(Projectile) and i.character.destroy_it
i.dispose
@projectile_sprites.delete(i)
end
}
if projectile.user.making_spiral
projectile.user.making_spiral = false
end
$game_player.projectiles.delete(projectile)
end
end
end
# Damage pop
def update_damagepop_sprites
@damagepop_sprites.each {|sprite| sprite.update if !sprite.disposed?}
$game_player.damage_pop.each do |target|
unless target.draw_it
@damagepop_sprites.push(Sprite_DamagePop.new(@viewport1, target))
target.draw_it = true
end
if target.destroy_it
@damagepop_sprites.each {|i|
if i.target.destroy_it
i.dispose
@damagepop_sprites.delete(i)
end
}
$game_player.damage_pop.delete(target)
end
end
end
#=================================
# ANIME SPRITES
def update_absanime_sprites
@animeabs_sprites.each {|s| s.update if !s.disposed?
unless $game_player.anime_action.include?(s.character)
s.dispose
@animeabs_sprites.delete(s)
$game_player.anime_action.delete(s.character)
end
}
$game_player.anime_action.each do |anime|
unless anime.draw_it
@animeabs_sprites.push(Sprite_Character.new(@viewport1, anime))
anime.draw_it = true
end
if anime.destroy_it
@animeabs_sprites.each {|i|
if i.character.is_a?(Anime_Obj) and i.character.destroy_it
i.dispose
@animeabs_sprites.delete(i)
end
}
$game_player.anime_action.delete(anime)
end
end
end
def update_dead_characters
for follower in $game_player.followers
next if follower.visible? == nil
next unless follower.battler.dead?
unless @dead_characters.include?(follower)
sprite = Sprite_DeadIcon.new(@viewport1, follower)
@dead_iconsprites.push(sprite)
@dead_characters.push(follower)
end
end
for sprite in @dead_iconsprites
sprite.update if !sprite.disposed?
if !sprite.character.battler.dead?
@dead_iconsprites.delete(sprite)
@dead_characters.delete(sprite.character)
sprite.dispose
end
end
end
alias falcaopearl_spdispose dispose
def dispose
dispose_pearl_main_sprites
falcaopearl_spdispose
end
# pearl abs disposing
def dispose_pearl_main_sprites
@dead_iconsprites.each {|icon| icon.dispose}
dispose_tool_sprite
dispose_state_icons
dispose_buff_icons
dispose_pearlabs_sprites
end
def dispose_pearlabs_sprites
@projectile_sprites.each {|pro| pro.dispose}
@projectile_sprites.clear
@damagepop_sprites.each {|target| target.dispose}
@damagepop_sprites.clear
@animeabs_sprites.each {|anime| anime.dispose}
@animeabs_sprites.clear
@enemy_drop_sprites.each {|sprite| sprite.dispose}
@enemy_drop_sprites.clear
end
end
Pearl Skillbar
Hier wird gleich am Anfang ein Bild eingefügt.
#===============================================================================
# * Falcao Pearl ABS script shelf # 4
#
# This script handles the Skillbar funtions
# it is designed to support the 'Mouse System Buttons script 1.6 and above too
# you can trigger tools by clicking the icons on the toolbar!
#===============================================================================
module PearlSkillBar
# Skillbar X position in tiles
Tile_X = 4
# Skillbar Y position in tiles
Tile_Y = 11
# Layout graphic
LayOutImage = "Pearl Skillbar"
# Follower attack command icon index
ToggleIcon = 116
# * Commands
#
# PearlSkillBar.hide - hide the skillbar
# PearlSkillBar.show - show the skillbar
#-----------------------------------------------------------------------------
def self.hide
$game_system.skillbar_enable = true
end
def self.show
$game_system.skillbar_enable = nil
end
def self.hidden?
!$game_system.skillbar_enable.nil?
end
end
class Game_System
attr_accessor :skillbar_enable, :pearlbars, :enemy_lifeobject
alias falcaopearl_abs_hud initialize
def initialize
unless PearlKernel::StartWithHud
@skillbar_enable = true
@pearlbars = true
end
falcaopearl_abs_hud
end
end
class Sprite_PearlTool < Sprite
include PearlSkillBar
attr_accessor :actor
def initialize(view, custom_pos=nil)
super(view)
@layout = ::Sprite.new(view)
@layout.bitmap = Cache.picture(LayOutImage)
@icons = ::Sprite.new(view)
@icons.bitmap = Bitmap.new(@layout.bitmap.width, @layout.bitmap.height)
self.bitmap = Bitmap.new(@layout.bitmap.width+32, @layout.bitmap.height+32)
if custom_pos.nil?
@layout.x = Tile_X * 32
@layout.y = Tile_Y * 32
else
@layout.x = custom_pos[0]
@layout.y = custom_pos[1]
end
@icons.x = @layout.x
@icons.y = @layout.y
self.x = @layout.x - 16
self.y = @layout.y - 12
self.z = self.z + 1
@actor = $game_player.actor
@actor.apply_usability
@old_usability = []
8.times.each {|i| @old_usability[i] = @actor.usability[i]}
@framer = 0
@info_keys = ::Sprite.new(view)
@info_keys.bitmap = Bitmap.new(self.bitmap.width, self.bitmap.height)
@info_keys.x = self.x; @info_keys.y = self.y; @info_keys.z = self.z
draw_key_info
refresh_icons
refresh_texts
@view = view
@on_map = SceneManager.scene_is?(Scene_Map)
@mouse_exist = defined?(Map_Buttons).is_a?(String)
@mouse_exist = false if @mouse_exist && !SceneManager.scene_is?(Scene_Map)
update
end
def draw_key_info
@info_keys.bitmap.font.size = 15
letters = [Key::Weapon[1], Key::Armor[1], Key::Item[1], Key::Item2[1],
Key::Skill[1],Key::Skill2[1],Key::Skill3[1],Key::Skill4[1],Key::Follower[1]]
x = 28
for i in letters
@info_keys.bitmap.draw_text(x, -2, @info_keys.bitmap.width, 32, i)
x += 32
end
end
def refresh_texts
self.bitmap.clear
self.bitmap.font.size = 15
refresh_cooldown
refresh_ammo
end
def number(operand)
return (operand / 60).to_i + 1
end
def flagged(item, type)
return :false if !item.cool_enabled? and type == 1
return item.itemcost if type == 2
end
# Refresh toolbar icons
def refresh_icons
@icons.bitmap.clear
icon = [@actor.equips[0], @actor.equips[1], @actor.assigned_item,
@actor.assigned_item2, @actor.assigned_skill, @actor.assigned_skill2,
@actor.assigned_skill3, @actor.assigned_skill4, ToggleIcon]
x = 4
icon.each {|i|
if !i.nil? and !i.is_a?(Fixnum)
if i.is_a?(RPG::Item) || i.is_a?(RPG::Skill)
draw_icon(i.icon_index, x, 6, @actor.usable?(i))
else
if i.is_a?(RPG::Weapon)
enable = @actor.usability[0] ; enable = true if enable.nil?
draw_icon(i.icon_index, x, 6, enable)
elsif i.is_a?(RPG::Armor)
enable = @actor.usability[1] ; enable = true if enable.nil?
draw_icon(i.icon_index, x, 6, enable)
end
end
end
draw_icon(i, x, 6) if i.is_a?(Fixnum) ; x += 32}
@now_equip = [@actor.equips[0], @actor.equips[1], @actor.assigned_item,
@actor.assigned_item2, @actor.assigned_skill, @actor.assigned_skill2,
@actor.assigned_skill3, @actor.assigned_skill4]
end
def update
update_mouse_tiles if @mouse_exist
update_cooldown
update_ammo_tools
update_usability_enable
refresh_icons if @now_equip[0] != @actor.equips[0]
refresh_icons if @now_equip[1] != @actor.equips[1]
refresh_icons if @now_equip[2] != @actor.assigned_item
refresh_icons if @now_equip[3] != @actor.assigned_item2
refresh_icons if @now_equip[4] != @actor.assigned_skill
refresh_icons if @now_equip[5] != @actor.assigned_skill2
refresh_icons if @now_equip[6] != @actor.assigned_skill3
refresh_icons if @now_equip[7] != @actor.assigned_skill4
update_fade_effect
end
# fade effect when player is behind the toolbar
def update_fade_effect
if behind_toolbar?
if self.opacity >= 60
self.opacity -= 10
@layout.opacity = @icons.opacity = @info_keys.opacity = self.opacity
end
elsif self.opacity != 255
self.opacity += 10
@layout.opacity = @icons.opacity = @info_keys.opacity = self.opacity
end
end
def behind_toolbar?
return false unless @on_map
px = ($game_player.screen_x / 32).to_i
py = ($game_player.screen_y / 32).to_i
9.times.each {|x| return true if px == Tile_X + x and py == Tile_Y}
return false
end
# refresh the icons when the usability change
def update_usability_enable
8.times.each {|i| refresh_icons if @old_usability[i] != @actor.usability[i]}
end
#-----------------------------------------------
# ammunition engine
def ammo_ready?(item)
return false if item.nil?
return true if item.has_data.nil? && item.is_a?(RPG::Item) &&
item.consumable
return false if flagged(item, 2).nil?
return true if flagged(item, 2) != 0
return false
end
# get item cost
def itemcost(item)
return $game_party.item_number(item) if item.has_data.nil? &&
item.is_a?(RPG::Item) && item.consumable
if !flagged(item, 2).nil? and flagged(item, 2) != 0
return $game_party.item_number($data_items[flagged(item, 2)])
end
return 0
end
# Ammo refresher
def refresh_ammo
if ammo_ready?(@actor.equips[0])
@wnumber = itemcost(@actor.equips[0])
self.bitmap.draw_text(18, 24, 32,32, @wnumber.to_s, 1)
end
if ammo_ready?(@actor.equips[1])
@anumber = itemcost(@actor.equips[1])
self.bitmap.draw_text(50, 24, 32,32, @anumber.to_s, 1)
end
if ammo_ready?(@actor.assigned_item)
@inumber = itemcost(@actor.assigned_item)
self.bitmap.draw_text(82, 24, 32,32, @inumber.to_s, 1)
end
if ammo_ready?(@actor.assigned_item2)
@inumber2 = itemcost(@actor.assigned_item2)
self.bitmap.draw_text(112, 24, 32,32, @inumber2.to_s, 1) # item 2
end
if ammo_ready?(@actor.assigned_skill)
@snumber = itemcost(@actor.assigned_skill)
self.bitmap.draw_text(144, 24, 32,32, @snumber.to_s, 1)
end
if ammo_ready?(@actor.assigned_skill2)
@snumber2 = itemcost(@actor.assigned_skill2)
self.bitmap.draw_text(176, 24, 32,32, @snumber2.to_s, 1) # skill 2
end
if ammo_ready?(@actor.assigned_skill3)
@snumber3 = itemcost(@actor.assigned_skill3)
self.bitmap.draw_text(208, 24, 32,32, @snumber3.to_s, 1) # skill 3
end
if ammo_ready?(@actor.assigned_skill4)
@snumber4 = itemcost(@actor.assigned_skill4)
self.bitmap.draw_text(240, 24, 32,32, @snumber4.to_s, 1) # skill 4
end
end
def update_ammo_tools
refresh_texts if ammo_ready?(@actor.equips[0]) &&
@wnumber != itemcost(@actor.equips[0])
refresh_texts if ammo_ready?(@actor.equips[1]) &&
@anumber != itemcost(@actor.equips[1])
if ammo_ready?(@actor.assigned_item) &&
@inumber != itemcost(@actor.assigned_item)
refresh_texts
end
refresh_texts if ammo_ready?(@actor.assigned_item2) && #@inumber2
@inumber2 != itemcost(@actor.assigned_item2)
refresh_texts if ammo_ready?(@actor.assigned_skill) &&
@snumber != itemcost(@actor.assigned_skill)
refresh_texts if ammo_ready?(@actor.assigned_skill2) && #@snumber2
@snumber2 != itemcost(@actor.assigned_skill2)
# new anmmo
refresh_texts if ammo_ready?(@actor.assigned_skill3) && #@snumber3
@snumber3 != itemcost(@actor.assigned_skill3)
refresh_texts if ammo_ready?(@actor.assigned_skill4) && #@snumber4
@snumber4 != itemcost(@actor.assigned_skill4)
end
#--------------------------------------
# cooldown engine
def cool_down_active?
return true if skill_cooldown > 0 || weapon_cooldown > 0 ||
armor_cooldown > 0 || item_cooldown > 0 || skill_cooldown2 > 0 ||
item_cooldown2 > 0 || skill_cooldown3 > 0 || skill_cooldown4 > 0
return false
end
def weapon_cooldown
if !@actor.equips[0].nil?
return 0 if flagged(@actor.equips[0], 1) == :false
cd = @actor.weapon_cooldown[@actor.equips[0].id]
return cd unless cd.nil?
end
return 0
end
def armor_cooldown
if !@actor.equips[1].nil?
return 0 if flagged(@actor.equips[1], 1) == :false
cd = @actor.armor_cooldown[@actor.equips[1].id]
return cd unless cd.nil?
end
return 0
end
def item_cooldown
if !@actor.assigned_item.nil?
return 0 if flagged(@actor.assigned_item, 1) == :false
cd = @actor.item_cooldown[@actor.assigned_item.id]
return cd unless cd.nil?
end
return 0
end
def item_cooldown2
if !@actor.assigned_item2.nil?
return 0 if flagged(@actor.assigned_item2, 1) == :false
cd = @actor.item_cooldown[@actor.assigned_item2.id]
return cd unless cd.nil?
end
return 0
end
def skill_cooldown
if !@actor.assigned_skill.nil?
return 0 if flagged(@actor.assigned_skill, 1) == :false
cd = @actor.skill_cooldown[@actor.assigned_skill.id]
return cd unless cd.nil?
end
return 0
end
def skill_cooldown2
if !@actor.assigned_skill2.nil?
return 0 if flagged(@actor.assigned_skill2, 1) == :false
cd = @actor.skill_cooldown[@actor.assigned_skill2.id]
return cd unless cd.nil?
end
return 0
end
# two new skillls
def skill_cooldown3
if !@actor.assigned_skill3.nil?
return 0 if flagged(@actor.assigned_skill3, 1) == :false
cd = @actor.skill_cooldown[@actor.assigned_skill3.id]
return cd unless cd.nil?
end
return 0
end
def skill_cooldown4 # 4
if !@actor.assigned_skill4.nil?
return 0 if flagged(@actor.assigned_skill4, 1) == :false
cd = @actor.skill_cooldown[@actor.assigned_skill4.id]
return cd unless cd.nil?
end
return 0
end
# Cooldown refresher
def refresh_cooldown
wcd = number(weapon_cooldown)
self.bitmap.draw_text(18, 36,32,32, wcd.to_s, 1) if weapon_cooldown > 10
acd = number(armor_cooldown)
self.bitmap.draw_text(50, 36,32,32, acd.to_s, 1) if armor_cooldown > 10
icd = number(item_cooldown)
self.bitmap.draw_text(82, 36,32,32, icd.to_s, 1) if item_cooldown > 10
icd2 = number(item_cooldown2)
self.bitmap.draw_text(112, 36,32,32, icd2.to_s, 1) if item_cooldown2 > 10
scd = number(skill_cooldown)
self.bitmap.draw_text(144, 36,32,32, scd.to_s, 1) if skill_cooldown > 10
scd2 = number(skill_cooldown2)
self.bitmap.draw_text(176, 36,32,32, scd2.to_s, 1) if skill_cooldown2 > 10
scd3 = number(skill_cooldown3)
self.bitmap.draw_text(208, 36,32,32, scd3.to_s, 1) if skill_cooldown3 > 10
scd4 = number(skill_cooldown4)
self.bitmap.draw_text(240, 36,32,32, scd4.to_s, 1) if skill_cooldown4 > 10
end
def update_cooldown
if @on_map and @actor != $game_player.actor
@actor = $game_player.actor
refresh_icons
refresh_texts
end
if $game_player.refresh_skillbar > 0
$game_player.refresh_skillbar -= 1
if $game_player.refresh_skillbar == 0
@actor.apply_usability
refresh_icons
end
end
if cool_down_active?
refresh_texts if @framer == 0
@framer += 1; @framer = 0 if @framer == 10
else
@framer = 0
end
end
# if mouse exist update the mouse settings
def update_mouse_tiles
mx = (Mouse.pos[0] / 32) ; my = (Mouse.pos[1] / 32)
case [mx, my]
when [Tile_X, Tile_Y] then $game_player.mouse_over = 1
when [Tile_X + 1, Tile_Y] then $game_player.mouse_over = 2
when [Tile_X + 2, Tile_Y] then $game_player.mouse_over = 3
when [Tile_X + 3, Tile_Y] then $game_player.mouse_over = 4
when [Tile_X + 4, Tile_Y] then $game_player.mouse_over = 5
when [Tile_X + 5, Tile_Y] then $game_player.mouse_over = 6
when [Tile_X + 6, Tile_Y] then $game_player.mouse_over = 7
when [Tile_X + 7, Tile_Y] then $game_player.mouse_over = 8
when [Tile_X + 8, Tile_Y] then $game_player.mouse_over = 9
else
$game_player.mouse_over = 0 if $game_player.mouse_over != 0
end
if $game_player.mouse_over > 0
create_mouse_blink
update_mouse_blink_position
@mouse_blink.opacity -= 3
@mouse_blink.opacity = 70 if @mouse_blink.opacity <= 6
else
dispose_mouse_blink
end
end
# update mouse blink position
def update_mouse_blink_position
case $game_player.mouse_over
when 1 then @mouse_blink.x = @layout.x + (5)
when 2 then @mouse_blink.x = @layout.x + (5 + 32)
when 3 then @mouse_blink.x = @layout.x + (5 + 64)
when 4 then @mouse_blink.x = @layout.x + (5 + 96)
when 5 then @mouse_blink.x = @layout.x + (5 + 128)
when 6 then @mouse_blink.x = @layout.x + (5 + 160)
when 7 then @mouse_blink.x = @layout.x + (5 + 192)
when 8 then @mouse_blink.x = @layout.x + (5 + 224)
when 9 then @mouse_blink.x = @layout.x + (5 + 256)
end
end
def create_mouse_blink
return if !@mouse_blink.nil?
@mouse_blink = ::Sprite.new(@view)
@mouse_blink.bitmap = Bitmap.new(22, 22)
@mouse_blink.bitmap.fill_rect(0, 0, 22, 22, Color.new(255,255,255))
@mouse_blink.y = @layout.y + 8
@mouse_blink.z = self.z
@mouse_blink.opacity = 70
end
def dispose_mouse_blink
return if @mouse_blink.nil?
@mouse_blink.dispose
@mouse_blink = nil
end
#--------- end of mouse settings
def dispose
self.bitmap.dispose
@layout.bitmap.dispose
@layout.dispose
@icons.bitmap.dispose
@icons.dispose
@info_keys.bitmap.dispose
@info_keys.dispose
super
end
def draw_icon(icon_index, x, y, enabled = true)
bit = Cache.system("Iconset")
rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
@icons.bitmap.blt(x, y, bit, rect, enabled ? 255 : 150)
end
end
Das sollten die Scripte sein in denen Bilder und/oder Icons angezeigt werden.
Wobei ich gerade mit der Idee liebäugel die alle via Script zu deaktivieren. Wäre schön für Sequenzen oder einfach in Städten dem Spieler ein gewisses Sicherheitsgefühl zu vermitteln.
In diversen RPG's wird das ja auch so gemacht. Würde jedoch die Variante wählen die beim Basteln weniger Arbeit macht.
Powered by vBulletin® Version 4.2.3 Copyright ©2025 Adduco Digital e.K. und vBulletin Solutions, Inc. Alle Rechte vorbehalten.