Obličeje v bitvě

Skripty pro RPG Makeru VX (nekompatibilní s verzí VX Ace).

Moderátor: Moderátoři

Uživatelský avatar
 
Příspěvky: 43
Registrován: březen 26, 2011, 4:38 pm

Obličeje v bitvě

Příspěvek od bobromils5 » duben 27, 2011, 12:54 pm

Co víc říct oběví se v bitvě obličeje.
Našel jsem to někde na netu.
Kód: Vybrat vše
#-------------------------------------------------------------------------------
# Battler Face HUD
# Version 1.0
# By Welfare-Daddy Pacman (rmrk.net)
# Description: There are a lot of battle scripts for VX out there, and they're
# mostly fantastic. However, they all require so much configuration. This script
# is the ultimate plug-and-play battle HUD: all you have to do is put it in the
# editor and alter one thing if you really want to. This script simply puts the
# actor's defined face into the battle window along with their HP and MP.
# Instructions: Put this script under materials and above main in the script
# editor. Change CharOpa to the desired opactiy if you wish, and let the
# script do the rest.
# Support: I reside almost ever-presently at rmrk.net.
#-------------------------------------------------------------------------------
# EDITING SECTION
#-------------------------------------------------------------------------------
# Place CharOpa as any number between 0 and 255. Default is 150. eg:
# CharOpa = 100
CharOpa = 150
#-------------------------------------------------------------------------------
# END EDITING SECTION
#-------------------------------------------------------------------------------

#==============================================================================
# ** Window_BattleStatus
#------------------------------------------------------------------------------
# This window displays the status of all party members on the battle screen.
#==============================================================================

class Window_BattleStatus < Window_Selectable
alias pacman_WBS_ini initialize
#-------------------------------------------------------------------------------
# Rewriting Initialize
#-------------------------------------------------------------------------------
def initialize
super(0,0,416,128,1)
@column_max = $game_party.members.size
refresh
self.active = false
self.opacity = 255
self.cursor_rect.set(0,self.index * 96, 90, 90)
end
#-------------------------------------------------------------------------------
# Rewriting draw_item
#-------------------------------------------------------------------------------
def draw_item(index)
rect = item_rect(index)
rect.x += 4
rect.width -= 8
rect.height = 96
self.contents.clear_rect(rect)
self.contents.font.color = normal_color
actor = $game_party.members[index]
draw_actor_face2(actor,index*96,0,80)
draw_actor_name(actor,index*96 + 8, 0)
draw_actor_state(actor, index*96 + 4, 32, 20)
self.contents.font.size = 14
draw_hp_and_mp(actor, index*96, 50, 90)
self.contents.font.size = 17
end
#-------------------------------------------------------------------------------
# Rewriting update_cursor
#-------------------------------------------------------------------------------
def update_cursor
if @index < 0
self.cursor_rect.empty
else
self.cursor_rect.set(index*96, 0, 90, 96)
end
end
end


#==============================================================================
# ** Window_Base
#------------------------------------------------------------------------------
# This is a superclass of all windows in the game.
#==============================================================================

class Window_Base < Window
#-------------------------------------------------------------------------------
# Writing draw_actor_face2
#-------------------------------------------------------------------------------
def draw_actor_face2(actor, x, y, width = 96, height = 96)
draw_face2(actor.face_name, actor.face_index, x, y, width, height)
end
#-------------------------------------------------------------------------------
# Once more for good luck!
#-------------------------------------------------------------------------------
def draw_face2(face_name, face_index, x, y, width = 96, height = 96)
bitmap = Cache.face(face_name)
rect = Rect.new(0, 0, 0, 0)
rect.x = face_index % 4 * 96 + (96 - width) / 2
rect.y = face_index / 4 * 96 + (96 - height) / 2
rect.width = width
rect.height = height -10
self.contents.blt(x+5, y+5, bitmap, rect, CharOpa)
bitmap.dispose
end
#-------------------------------------------------------------------------------
# Writing draw_hp_and_mp
#-------------------------------------------------------------------------------
def draw_hp_and_mp(actor,x,y,width)
back_color = Color.new(39, 58, 83, 255)
hp_color1 = Color.new(66, 114, 164, 255)
hp_color2 = Color.new(122, 175, 229, 255)
mp_color1 = Color.new(93, 50, 158, 255)
mp_color2 = Color.new(145, 122, 229, 255)
self.contents.fill_rect(x+5,y+15,width-10,7,back_color)
self.contents.gradient_fill_rect(x+7,y+17,(width-14)*actor.hp/actor.maxhp,3,hp_color1,hp_color2)
self.contents.draw_text(x+5,y,width-10,20,Vocab::hp,0)
self.contents.draw_text(x+5,y,width-10,20,actor.hp.to_s + "/" + actor.maxhp.to_s,2)
self.contents.fill_rect(x+5,y+35,width-10,7,back_color)
self.contents.gradient_fill_rect(x+7,y+37,(width-14)*actor.mp/actor.maxmp,3,mp_color1,mp_color2)
self.contents.draw_text(x+5,y+20,width-10,20,Vocab::mp,0)
self.contents.draw_text(x+5,y+20,width-10,20,actor.mp.to_s + "/" + actor.maxmp.to_s,2)
end
end
#-------------------------------------------------------------------------------
# END
#-------------------------------------------------------------------------------

Zpět na Skripty pro RPG Maker VX

Kdo je online

Uživatelé procházející toto fórum: Žádní registrovaní uživatelé a 2 návštevníků