Elekami Fondateur
Messages postés : 19071 Date d'inscription : 19/07/2008 Jauge LPC :
| Sujet: [XP] Combat vue de dos Lun 20 Avr 2009 - 13:11 | |
| Tout est dans le titre. screen: https://i.servimg.com/u/f59/12/39/29/96/back_f12.jpg auteur: Auteur : パラ犬 (c'est ecrit en Jap ou Chin) Testé, ça marche; mais changer la position des battlers ennemis dans les groupes de monstres. - Code:
-
#============================================================================== # ++ サイドビューバトル(歩行グラフィック版) ver. 1.14 ++ # Script by パラ犬 # http://para.j-mx.com/ #------------------------------------------------------------------------------ # バトルフィールドに歩行グラフィックを表示します。 #==============================================================================
module SDVA X_LINE = 140 # 横位置のバトラー表示座標 Y_LINE = 300 # 縦位置のバトラー表示座標 X_SPACE = 120 # 横位置のバトラー同士の間隔 Y_SPACE = 0 # 縦位置のバトラー同士の間隔 X_POSITION = 0 # 隊列[前衛・中衛・後衛]の横間隔 Y_POSITION = 10 # 隊列[前衛・中衛・後衛]の縦間隔 ATTACK_MOVE = true # 攻撃時に前へ踏み出すか( true / false ) SKILL_MOVE = true # スキル使用時に前へ踏み出すか( true / false ) ITEM_MOVE = false # アイテム使用時に前へ踏み出すか( true / false ) MOVE_STEP = 1 # 移動歩数 MOVE_PIXEL = 10 # 一歩あたりのピクセル数 PARTY_POS = 3 # キャラクターの向き( 0:下 / 1:左 / 2:右 / 3:上 )
WINDOWPOS_CHANGE = true # コマンドウインドウをバトラーの横に表示するか( true / false )
end #============================================================================== # ■ Game_Actor #==============================================================================
class Game_Actor < Game_Battler #-------------------------------------------------------------------------- # ● バトル画面 X 座標の取得 #-------------------------------------------------------------------------- def screen_x if self.index != nil # 隊列を取得 pos = $data_classes[self.class_id].position x_pos = pos * SDVA::X_POSITION scr_x = self.index * SDVA::X_SPACE + SDVA::X_LINE + x_pos # 移動アクションのとき if self.current_action.move_action == true # 横に移動 scr_x += @shift_x end return scr_x else return 0 end end #-------------------------------------------------------------------------- # ● バトル画面 Y 座標の取得 #-------------------------------------------------------------------------- def screen_y if self.index != nil # 隊列を取得 pos = $data_classes[self.class_id].position y_pos = pos * SDVA::Y_POSITION scr_y = self.index * SDVA::Y_SPACE + SDVA::Y_LINE + y_pos # 移動アクションのとき if self.current_action.move_action == true # 縦に移動 scr_y += @shift_y end return scr_y else return 0 end end #-------------------------------------------------------------------------- # ● バトル画面 Z 座標の取得 #-------------------------------------------------------------------------- def screen_z if self.index != nil return self.index else return 0 end end end
#============================================================================== # ■ Game_Battler (分割定義 1) #==============================================================================
class Game_Battler #-------------------------------------------------------------------------- # ● 公開インスタンス変数 #-------------------------------------------------------------------------- attr_reader :pattern # 歩行パターン attr_reader :trans_x # X方向の移動距離 attr_reader :moving # 移動中フラグ #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- alias initialize_sdva initialize def initialize initialize_sdva move_reset end #-------------------------------------------------------------------------- # ○ 移動カウント #-------------------------------------------------------------------------- def move @moving = 1 if @step < SDVA::MOVE_STEP # 歩数を満たすまで移動 @pattern = (@pattern + 1) % 4 @step += 1 move_step else # 移動終了 @pattern = 1 @moving = 2 end end #-------------------------------------------------------------------------- # ○ 移動処理 #-------------------------------------------------------------------------- def move_step # パーティの向きによって移動座標を変える case SDVA::PARTY_POS when 0 @shift_y = @step * SDVA::MOVE_PIXEL when 1 @shift_x = -(@step * SDVA::MOVE_PIXEL) when 2 @shift_x = @step * SDVA::MOVE_PIXEL when 3 @shift_y = -(@step * SDVA::MOVE_PIXEL) end end #-------------------------------------------------------------------------- # ○ 移動のリセット #-------------------------------------------------------------------------- def move_reset @moving = 0 @pattern = 0 @step = 0 @shift_x = 0 @shift_y = 0 end end
#============================================================================== # ■ Game_BattleAction #==============================================================================
class Game_BattleAction #-------------------------------------------------------------------------- # ● 公開インスタンス変数 #-------------------------------------------------------------------------- attr_accessor :move_action # 移動するアクションか #-------------------------------------------------------------------------- # ● クリア #-------------------------------------------------------------------------- alias clear_sdva clear def clear clear_sdva @move_action = false end end
#============================================================================== # ■ Sprite_Battler #==============================================================================
class Sprite_Battler < RPG::Sprite #-------------------------------------------------------------------------- # ● フレーム更新 #-------------------------------------------------------------------------- alias update_sdva update def update # バトラーがアクターに含まれるとき if @battler.is_a?(Game_Actor) # ファイル名か色相が現在のものと異なる場合 # 行動中の場合 if @battler.battler_name != @battler_name or @battler.battler_hue != @battler_hue or @battler.current_action.basic == 0 or @battler.current_action.kind != 3 # ビットマップを取得、設定 @character_name = @battler.character_name @character_hue = @battler.character_hue # 歩行グラフィックを描画 self.bitmap = RPG::Cache.character(@character_name, @character_hue) cw = self.bitmap.width / 4 ch = self.bitmap.height / 4 @width = cw @height = ch if @battler.current_action.move_action == true # 歩かせる @battler.move else @battler.move_reset end # 転送元の矩形を設定 sx = @battler.pattern * cw sy = SDVA::PARTY_POS * ch self.src_rect.set(sx, sy, cw, ch) self.ox = @width / 2 self.oy = @height # 隠れ状態なら不透明度を 0 にする if @battler.hidden self.opacity = 0 end end end update_sdva end end |
|
Alsaas Paysan (niveau 2)
Messages postés : 14 Date d'inscription : 28/06/2012 Jauge LPC :
| Sujet: Re: [XP] Combat vue de dos Ven 29 Juin 2012 - 0:34 | |
| Les petits héros contre les grands fantôme *.* Bref merci du partage hein |
|
Zexion Administrateur
Messages postés : 6228 Date d'inscription : 04/01/2012 Jauge LPC :
| Sujet: Re: [XP] Combat vue de dos Ven 29 Juin 2012 - 0:38 | |
| Rien t'empêche de remplacer le battler des ennemis par une image de leur chara. (Fais gaffe à ne pas faire nécroposts, vérifies toujours la date du dernier message posté). |
|
Contenu sponsorisé
| Sujet: Re: [XP] Combat vue de dos | |
| |
|