| Roi |
 |
 |
Inscrit le: 13 Aoû 2006, 00:00 Messages: 2414 Localisation: Montréal, QC Logiciel(s) préféré(s): RMXP, VS2008 Point(s) Fort(s): Script Points d'aide: Illimité
Créations :
- Séparation d'inventaire
- Sprite_Text
Voir ses créations
|
Script :- Code: Tout sélectionner
#Crée par momomomo? et traduit par Yue # #Pour que les héros soyent disponible il faut activer et désactiver des interrupteurs #(voir ligne 82 a 99) #Qui se trouve dans: class Window_Party_Select : party_in_menber # #●設定方法 #・最大パーティー加入人数 # すぐ下の @party_max = 4 の部分を変更、通常は4。 # #・最低パーティー加入人数(最低選択しなければならない人数) # @party_min = 1 の部分を変更、初期ではとりあえず1に設定。 # # # Dans le PHS il est obligatoire d'avoir au moin 1 héro, pour changer #le nombre d'héros il faut changer cette partie : # $game_party.must_actors = [1] # et mettre avec le 1 le nombre d'actors au minimum pour que le PHS marche. #Par exemple si $game_party.must_actors = [1, 2, 3] alors il faudra au moin 3 membres dans #l'équipe pour que le PHS fonctionne. # # # Il peut y avoir jusqu'a 8 héros pour le PHS, il est préfèrable de prévoir 1 à 7 voir 8 #interrupteurs de libres pour utiliser le PHS. # L'ID du héro dans menber.push($game_actors[ID]) doit correspondre a l'ID du héro voulu #Par exemple si le héros Arshes a pour ID [1] alors menber.push($game_actors[1]) # #Il est possible de voir les stats des héros lors du PHS grâce a la touche Z # # # Ce script a était crée le 24 septembre 2005 sous par momomomo? merci de bien faire crédit a cet jeune personne #pour le travaille qu'elle a fournit.
class Game_Party attr_accessor :party_max attr_accessor :party_min attr_accessor :must_actors alias party_select_initialize initialize def initialize party_select_initialize @party_max = 4 @party_min = 1 @must_actors = [1] end def must_actor_include?(actor) return @must_actors.include?(actor.id) end end
class Window_Party_Select < Window_Selectable #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize super(0, 96, 640, 384) @party_in_ok_menber = party_in_menber @item_max = party_in_menber.size @column_max = 4 self.contents = Bitmap.new(width - 32, row_max * 88) self.index = 0 refresh end #-------------------------------------------------------------------------- # ● アクターの取得 #-------------------------------------------------------------------------- def menber return @party_in_ok_menber[self.index] end #-------------------------------------------------------------------------- # ● party_in_menber (héros pour PHS) #-------------------------------------------------------------------------- def party_in_menber menber = [] menber.push($game_actors[1]) menber.push($game_actors[2]) if $game_switches[1] menber.push($game_actors[3]) if $game_switches[2] menber.push($game_actors[4]) if $game_switches[3] menber.push($game_actors[5]) if $game_switches[4] menber.push($game_actors[6]) if $game_switches[5] menber.push($game_actors[7]) if $game_switches[6] menber.push($game_actors[8]) if $game_switches[7] return menber end #Pour que le héro[2] soit disponible pour le PHS il faut activer l'interrupteur [001] #Pour que le héro[2] ne soit plus disponible pour le PHS il faut désactiver l'interrupteur [001] #Pour qu'un héros ne soit pas disponible dès le départ il faut mettre :" if $game_switches[ID]" #a côté de:" menber.push($game_actors[ID]) " (sans prendre les guillemets) #-------------------------------------------------------------------------- # ● リフレッシュ #-------------------------------------------------------------------------- def refresh self.contents.clear for i in 0...@party_in_ok_menber.size draw_menber(i) end end #-------------------------------------------------------------------------- # ● アクター描画 #-------------------------------------------------------------------------- def draw_menber(index) actor = @party_in_ok_menber[index] x = 4 + index % @column_max * (640 / @column_max) y = index / @column_max * 88 if $game_party.must_actor_include?(actor) color = text_color(3) opacity = 255 elsif $game_party.actors.include?(actor) color = normal_color opacity = 255 else color = disabled_color opacity = 128 end self.contents.font.color = color self.contents.draw_text(x, y, 120, 32, actor.name) bitmap = RPG::Cache.character(actor.character_name, actor.character_hue) cw = bitmap.width / 4 ch = bitmap.height / 4 src_rect = Rect.new(0, 0, cw, ch) self.contents.blt(x+32 - cw / 2, y+64+16 - ch, bitmap, src_rect, opacity) end #-------------------------------------------------------------------------- # ● 行数の取得 #-------------------------------------------------------------------------- def row_max # 項目数と列数から行数を算出 return (@item_max + @column_max - 1) / @column_max end #-------------------------------------------------------------------------- # ● 先頭の行の取得 #-------------------------------------------------------------------------- def top_row # ウィンドウ内容の転送元 Y 座標を、1 行の高さ 32 で割る return self.oy / 88 end #-------------------------------------------------------------------------- # ● 先頭の行の設定 # row : 先頭に表示する行 #-------------------------------------------------------------------------- def top_row=(row) # row が 0 未満の場合は 0 に修正 if row < 0 row = 0 end # row が row_max - 1 超の場合は row_max - 1 に修正 if row > row_max - 1 row = row_max - 1 if row < 0 row = 0 end end # row に 1 行の高さ 32 を掛け、ウィンドウ内容の転送元 Y 座標とする self.oy = row * 88 end #-------------------------------------------------------------------------- # ● 1 ページに表示できる行数の取得 #-------------------------------------------------------------------------- def page_row_max # ウィンドウの高さから、フレームの高さ 32 を引き、1 行の高さ 32 で割る return (self.height - 32) / 88 end #-------------------------------------------------------------------------- # ● カーソルの矩形更新 #-------------------------------------------------------------------------- def update_cursor_rect if @index < 0 self.cursor_rect.empty return end # 現在の行を取得 row = @index / @column_max # 現在の行が、表示されている先頭の行より前の場合 if row < self.top_row # 現在の行が先頭になるようにスクロール self.top_row = row end # 現在の行が、表示されている最後尾の行より後ろの場合 if row > self.top_row + (self.page_row_max - 1) # 現在の行が最後尾になるようにスクロール self.top_row = row - (self.page_row_max - 1) end # カーソルの幅を計算 cursor_width = 512 / @column_max # カーソルの座標を計算 x = @index % @column_max * (cursor_width + 32)#(640 / @column_max) y = @index / @column_max * 88 - self.oy # カーソルの矩形を更新 self.cursor_rect.set(x, y, cursor_width, 32) end end
class Window_Party_Select_Menber < Window_Base #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize super(0, 0, 640, 96) self.contents = Bitmap.new(width - 32, height - 32) refresh end #-------------------------------------------------------------------------- # ● リフレッシュ #-------------------------------------------------------------------------- def refresh self.contents.clear for i in 0...$game_party.actors.size draw_menber(i) end end #-------------------------------------------------------------------------- # ● アクター描画 #-------------------------------------------------------------------------- def draw_menber(index) actor = $game_party.actors[index] x = 4 + index * (640 / $game_party.party_max) y = 0 draw_actor_graphic(actor, x+32, y+48+8) end end
class Window_Party_Select_Menber_Status < Window_Base #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize super(0, 288, 640, 192) self.contents = Bitmap.new(width - 32, height - 32) self.visible = false end #-------------------------------------------------------------------------- # ● stats des héros en appuyant sur Z #-------------------------------------------------------------------------- def refresh(actor) self.contents.clear draw_actor_name(actor, 4, 0) draw_actor_class(actor, 4 + 144, 0) draw_actor_level(actor, 4, 32) draw_actor_state(actor, 4 + 72, 32) draw_actor_hp(actor, 4, 64, 172) draw_actor_sp(actor, 4, 96, 172) draw_actor_parameter(actor, 218, 32, 0) draw_actor_parameter(actor, 218, 64, 1) draw_actor_parameter(actor, 218, 96, 2) draw_actor_parameter(actor, 430, 32, 3) draw_actor_parameter(actor, 430, 64, 4) draw_actor_parameter(actor, 430, 96, 5) draw_actor_parameter(actor, 430, 128, 6) end end
|
|