Jump to content
Rpg²S Forum

DarkSchneider

Utenti
  • Posts

    68
  • Joined

  • Last visited

Posts posted by DarkSchneider

  1. inserisci questo sotto class Game_Player

     

    attr_writer :base_speed
     def initialize
    super
    @dash_count = 0
    @base_speed = 4
    @move_increase = 2
    @dash_steps = 4
     end

     

    e sostituisci questo update col vecchio

     

    def update
    # Remember whether or not moving in local variables
    last_moving = moving?
    # If moving, event running, move route forcing, and message window
    # display are all not occurring
    unless moving? or $game_system.map_interpreter.running? or
    	   @move_route_forcing or $game_temp.message_window_showing
      # Move player in the direction the directional button is being pressed
      if @dash_count > 0
    				 move_forward
    	 @dash_count -= 1
      else
    	 @move_speed = @base_speed
      case Input.dir4
      when 2
    	move_down
      when 4
    	move_left
      when 6
    	move_right
      when 8
    	move_up
      end
    end
    			unless $game_system.map_interpreter.running? or
    				@move_route_forcing or $game_temp.message_window_showing
    				 if Input.trigger?(Input::SHIFT)
    				   if @dash_count == 0
    					 @dash_count = @dash_steps
    					 @move_speed += @move_increase
    				   end
    				 end
    			end
    # Remember coordinates in local variables
    last_real_x = @real_x
    last_real_y = @real_y
    super
    # If character moves down and is positioned lower than the center
    # of the screen
    if @real_y > last_real_y and @real_y - $game_map.display_y > CENTER_Y
      # Scroll map down
      $game_map.scroll_down(@real_y - last_real_y)
    end
    # If character moves left and is positioned more let on-screen than
    # center
    if @real_x < last_real_x and @real_x - $game_map.display_x < CENTER_X
      # Scroll map left
      $game_map.scroll_left(last_real_x - @real_x)
    end
    # If character moves right and is positioned more right on-screen than
    # center
    if @real_x > last_real_x and @real_x - $game_map.display_x > CENTER_X
      # Scroll map right
      $game_map.scroll_right(@real_x - last_real_x)
    end
    # If character moves up and is positioned higher than the center
    # of the screen
    if @real_y < last_real_y and @real_y - $game_map.display_y < CENTER_Y
      # Scroll map up
      $game_map.scroll_up(last_real_y - @real_y)
    end
    # If not moving
    unless moving?
      # If player was moving last time
      if last_moving
    	# Event determinant is via touch of same position event
    	result = check_event_trigger_here([1,2])
    	# If event which started does not exist
    	if result == false
    	  # Disregard if debug mode is ON and ctrl key was pressed
    	  unless $DEBUG and Input.press?(Input::CTRL)
    		# Encounter countdown
    		if @encounter_count > 0
    		  @encounter_count -= 1
    		end
    	  end
    	end
      end
      # If C button was pressed
      if Input.trigger?(Input::C)
    	# Same position and front event determinant
    	check_event_trigger_here([0])
    	check_event_trigger_there([0,1,2])
      end
    end
     end

     

    @base_speed è la velocità del pg puoi modificarla dallo script o con un call script da evento scrivendo $game_player.base_speed = *numero*

     

    @move_increase è l aumento di velocità durante il dash (velocità di base + @move_increase)

    @dash_steps è il numero di passi percorsi durante il dash

     

    non ho mai giocato a kingdom hearts spero di aver capito la tua richiesta :)

  2. @item_max indica il numero di oggetti che la window contiene non c entra niente col numero di pg nel party. se provi a fare la modifica che ti ho mostrato con due pg nel party noterai che non andrà piu a finire sul terzo spazio. per avere il party composto al massimo di 3 pg o stai attento a non far aggiugere altri pg al party con gli eventi oppure dovresti modificare questa parte in game_party

    def add_actor(actor_id)
    # Get actor
    actor = $game_actors[actor_id]
    # If the party has less than 4 members and this actor is not in the party
    if @actors.size < 4 and not @actors.include?(actor)
    # Add actor
    @actors.push(actor)
    # Refresh player
    $game_player.refresh
    end
    end
    

    cambiando il 4 con 3 o con un numero maggiore di 4 per avere un party piu grande :)

  3. def refresh
    self.contents.clear
    self.contents.font.name = "Arial"
    self.contents.font.size = 24
    @item_max = 3
    for i in 0...$game_party.actors.size
    x = 64
    y = i * 144
    actor = $game_party.actors[i]
    #inserisce le facce degli eroi nel menu
    face = RPG::Cache.picture(actor.name)
    rect = Rect.new(0, 0,face.width,face.height)
    self.contents.blt(x - 35,y + 18,face,rect)
    #Con questo codice hai inserito il codice dei face
    draw_actor_name(actor, x + 108, y + 10)
    draw_actor_level(actor, x + 108, y + 39)
    draw_actor_exp(actor, x + 108, y + 64)
    draw_actor_hp(actor, x + 108, y + 89)
    draw_actor_sp(actor, x + 108, y + 114)
    end
    end
    
    

    @item_max deve essere uguale a $game_party.actors.size

  4. ho provato la demo hai fatto un buon lavoro graficamente sei riuscito a riproporre il sistema di turni alla ffx pero il problema è che il bs di ffx funziona in maniera differente

     

    ti spiego rapidamente il suo funzionamento:

    in battaglia c è un contatore che diminuisce fino non è uguale al valore di iniziativa di un pg (o mostro)poi quando viene scelta l azione il suo prossimo turno sarà uguale al valore base di iniziativa + un valore associato all azione sceltae cosi via... cmq su gamefaqs puoi trovare una spiegazione piu dettagliata

     

    Nel tuo script la visualizzazione dei turni non è molto utile perchè dopo il primo turno si sa gia quali sono i turni successivi visto che l iniziativa non cambia pero se intendi solo far vedere i turni va piu che bene cosi

  5. la demo è fatta molto bene il mapping è ottimo la grafica anche se è rtp è fruttata benissimo l unica cosa che non mi convince sono gli alberi forse dovresti ricolorarli per farli intonare di piu con il resto del tileset

     

    arrivato al villaggio vicino al tempio asakudo non so piu dove andare

     

    ti segnalo un di bug:

     

    - nel negozio di jarin praticamente si puo passare sopra qualsiasi cosa :)

    - il tipo all entrata del villaggio continua a muoversi ogni volta che si aziona l evento fino a quando non si blocca contro il muro

    - sul muro dove c è il volantino con la taglia ci si puo saltare sopra

    - ogni tanto quando si cambia mappa parte da solo il messaggio "mangio subito - raccolgo per dopo" senza la carne per terra

    - il pg non fa sempre l animazione dell attacco

    - la cifra del denaro posseduto dell inn e dello shop è non si legge è troppo scura

    - nel negozio nella fiinestra affianco a quella degli oggetti in vendita c è scritto prezzo ma dovrebbe essere la quantita posseduta di un determinato oggetto

    - il bs è da migliorare

    - nell imboscata della bambina dopo aver ammazzato i lupi e prima di riparlare con lei cliccando sul cespuglio sopra il tronco esce uno strano messaggio (non ricordo cosa)

     

    per il momento è tutto se mi dici come andare avanti nel villaggio continuo a giocarci

  6. questo è uno script di un tipo giapponese simile a ffx

     

     

    ##############################################################
    ###########
    # FF10にあった、カウントタイムバトル的なモノです。
    #
    # ☆良くあるATB(ゲージがたまると行動可能になるやつね)との違い
    # ・行動順を割り出す計算式が変わっています。
    # ATBでは毎フレームすばやさに応じた値が足されていき、
    # 行動を終了したら規定の値(ほとんどの方が0だと思いますが)になります。
    # それに対して、この似非CTBシステム(以下CTB)では、
    # 全員のゲージが同じスピードで上昇し、
    # 行動を終了したあと、素早さに応じた値を減算します。
    # このため、行動順がATBと微妙に変化するかと思われます。
    #
    # ・行動順の表示が名前の羅列になってます。
    # この名前は、ゲージのように動くことはなく、
    # 現在の行動者含めて五人先の人までを名前で表示しています。
    # なお、行動先読みには「全ての行動が物理攻撃だった時」を前提にしてます。
    # そのため、スキルやアイテムなどを使ってしまうと、その分微妙にズレます。
    #
    # ☆制約
    # ・パーティーが三人
    # 行動順を表示する部分どこにあっても邪魔なので、
    # 結局パーティー表示部分の左端を削りました。
    #
    # ・「何もしない」の動作が不審
    # 何の前触れもなくスキップしてしまうように設定していますので、
    # 見かけ上は無視されたように見えてしまいます。
    #
    # ☆特殊操作
    # ・パーティーコマンド呼び出し
    # アクターのコマンドが表示されている時にXボタンを押してください。
    # パーティーコマンドが呼び出されます。
    # 戦闘再開はそのまま、戦闘再開。
    # 行動順表示は、50人先まで行動順を表示します。
    # あまり使えないかもしれませんが。
    # 一応、L、Rによるページ送り機能などもつけてます。
    # 逃走は、「全員のCPを一定値減算したのち、逃走する」という形式にしてます。
    #
    # ☆スキルについて
    # 「スキル名,ディレイ値,詠唱時間」とスキル名を書き換えてください。
    # ディレイ値は「その行動が終了した後に減算するCPの基準となる値」です。
    # たとえば通常攻撃はこれがCP_COST_ATTACKで定義されています。
    # 何も書いていない場合の値も定義可能です。
    # 詠唱時間は「そのスキルが発動するまでの時間」です。
    # 詠唱中はステート「詠唱」が付加されます。
    # 攻撃の場合はもちろんこの詠唱時間は0ですね。
    # なので、こんな感じで↓
    # 「クイックカット,120,0」
    # これでCP_COST_ATTACKを120以上にしておけば、
    # 通常攻撃よりも早く次の出番がきますね。
    # 「パワフルスイング,100,120」
    # これだとスキルを選択してから発動するまでのタイムラグが120ありますね。
    #########################################################################
    
    #==============================================================================
    # ■ 初期定義
    #==============================================================================
    module RPG
    class Skill
    CP_COST_DELAY = 300 # スキルで値を何も書いていない場合のディレイ値
    CP_COST_SPELL = 300 # スキルで値を何も書いていない場合の詠唱時間
    end
    end
    
    module CTB_Define
    # 詠唱ステートのID
    SPELL_STATE_ID = 300
    # 消費CP
    # 消費CPの算出方法は「消費CP(ここで定義)×すばやさ平均÷すばやさ」です。
    CP_COST_ITEM   = 200 # アイテムを使用したときの減算値
    CP_COST_ATTACK  = 300 # 攻撃したときの減算値
    CP_COST_GUARD   = 200 # 防御したときの減算値
    CP_COST_NOTHING = 100 # なにもしないときの減算値
    CP_COST_ESCAPE  = 100 # 「逃げる」時*全員の*の減算値
    CP_COST_SKILL  = [0,300,300,400,300,300,300,300,400,300,300,400,300,300,400,300,300,400,300,300,4
    00,300,300,400,300,300,400,300,300,400,400,550,250,350,250,350,250,350,250,350,2
    5
    0,350,250,350,250,350,250,350,250,350,250,350,400,400,400,400,200,300,400,500,20
    0
    ,300,400,500,200,300,400,500,200,300,400,500,200,300,400,500,200,300,400,500,900
    ]
    end
    
    #==============================================================================
    # ■ RPG::Skill
    #==============================================================================
    module RPG
    class Skill
      def name
        name = @name.split(/,/)[0]
        return name != nil ? name : ''
      end
      def delay
        name = @name.split(/,/)[1].to_i
        return name != nil ? name : CP_COST_DELAY
      end
      def spell
        name = @name.split(/,/)[2].to_i
        return name != nil ? name : CP_COST_SPELL
      end
    end
    end
    
    #==============================================================================
    # ■ Window_CTB
    #------------------------------------------------------------------------------
    # キャラの行動順を表示するウィンドウです。
    #==============================================================================
    class Window_CTB < Window_Base
    # 詠唱ステートのID読み込み
    include CTB_Define
    #--------------------------------------------------------------------------
    # ● オブジェクト初期化
    #--------------------------------------------------------------------------
    def initialize(avg)
      super(0, 320, 160, 160)
      self.contents = Bitmap.new(self.width - 32, self.height - 32)
      # 平均AGI算出   
      @agi_avg = avg
      # キャラ名列
      @names = []
    end
    #--------------------------------------------------------------------------
    # ● リフレッシュ
    #--------------------------------------------------------------------------
    def refresh
      # 再描画開始
      self.contents.clear
       self.contents.font.name = "Tahoma"
      self.contents.font.size = 20
      self.contents.font.color = system_color
      self.contents.font.size = 16
      self.contents.draw_text(0, 0, 100, 17, "Turn Ratio")
      # キャラ名列
      @names = []
      # 攻撃コマンド後の全員のCPを先読み
      get_cps
      # cpの値でソート
      @names.sort!{|a,b| b[0] <=> a[0] }   
      h = 0
      self.contents.font.size = 17
      for i in 0...6
        @nam = @names[i]
        if @nam == nil
          break
        end
        x = 4
        y = 18 * h + 17
        if @nam[0] >= 500 # 500より大きければ白文字。
          if @nam[2] == true
            self.contents.font.color = Color.new(230, 255, 255, 255)
          else
             self.contents.font.name = "Tahoma"
      self.contents.font.size = 12
            self.contents.font.color = normal_color
          end
        else
          if @nam[2] == true
            self.contents.font.color = Color.new(190, 225, 225, 255)
          else
            self.contents.font.color = disabled_color
          end
        end
        self.contents.draw_text(x, y, 128, 18, @nam[1])
        h += 1
      end
    end
    #--------------------------------------------------------------------------
    # ● 行動後のCPの取得
    #--------------------------------------------------------------------------
    def get_cps
      # メンバー全員の行動後のCPと名前を@namesに格納
      i = 0
      while @names.size < 15
        for member in $game_party.actors + $game_troop.enemies
          next if member.dead? or !member.exist?
          cp = CP_COST_ATTACK * @agi_avg / member.agi # 攻撃時に減算するCP先読み
          if i == 1 and member.current_action.kind == 1
            skill = $data_skills[member.current_action.skill_id]
            cp = CP_COST_SKILL[skill.id] * @agi_avg / member.agi
          end
          cp = member.cp - (cp * i)
          if i == 0
            spell = member.state?(SPELL_STATE_ID)
          else
            spell = false
          end
          @names.push([cp, member.name, spell])
        end
        i += 1
      end
    end
    #--------------------------------------------------------------------------
    # ● CTBウィンドウの中身が空かどうかを確認する
    #--------------------------------------------------------------------------
    def names_empty
      if @names == []
        return true
      else
        return false
      end
    end
    end
    
    #==============================================================================
    # ■ Window_CTB_All
    #------------------------------------------------------------------------------
    # キャラの行動順を表示するウィンドウの拡大版です。
    #==============================================================================
    class Window_CTB_All < Window_Base
    # 詠唱ステートのID読み込み
    include CTB_Define
    #--------------------------------------------------------------------------
    # ● オブジェクト初期化
    #--------------------------------------------------------------------------
    def initialize(avg)
      super(0, 0, 160, 480)
      self.contents = Bitmap.new(self.width - 32, self.height - 32)
       self.contents.font.name = "Tahoma"
      self.contents.font.size = 12
      # 平均AGI算出   
      @agi_avg = avg
      # キャラ名列
      @names = []
      # 攻撃コマンド後の全員のCPを先読み
      get_init_cps
      # cpの値でソート
      @names.sort!{|a,b| b[0] <=> a[0] }
    end
    #--------------------------------------------------------------------------
    # ● リフレッシュ
    #--------------------------------------------------------------------------
    def refresh(id)
      # 再描画開始
      self.contents.clear
       self.contents.font.name = "Tahoma"
      self.contents.font.size = 20
      self.contents.font.color = system_color
      self.contents.font.size = 18
      self.contents.draw_text(0, 0, 100, 20, "Turn Ratio")
      h = 0
      self.contents.font.size = 19
      for i in id-1...[id+18,50].min
        @nam = @names[i]
        if @nam == nil
          break
        end
        x = 4
        y = 22 * h + 20
        if @nam[0] >= 500 # 500より大きければ白文字。
          if @nam[2] == true
            self.contents.font.color = Color.new(230, 255, 255, 255)
          else
            self.contents.font.color = normal_color
          end
        else
          if @nam[2] == true
            self.contents.font.color = Color.new(190, 225, 225, 255)
          else
            self.contents.font.color = disabled_color
          end
        end
         self.contents.font.name = "Tahoma"
      self.contents.font.size = $fontsize
        self.contents.draw_text(x, y, 32, 22, (i+1).to_s)
        self.contents.draw_text(x+32, y, 128, 22, @nam[1])
        h += 1
      end
    end
    #--------------------------------------------------------------------------
    # ● 行動後のCPの取得
    #--------------------------------------------------------------------------
    def get_init_cps
      # メンバー全員の行動後のCPと名前を@namesに格納
      i = 0
      while @names.size < 75
        for member in $game_party.actors + $game_troop.enemies
          next if member.dead? or !member.exist?
          cp = CP_COST_ATTACK * @agi_avg / member.agi # 攻撃時に減算するCP先読み
          if i == 1 and member.current_action.kind == 1
            @skill = $data_skills[@active_battler.current_action.skill_id]
            skill = $data_skills[member.current_action.skill_id]
            cp = CP_COST_SKILL[skill.id] * @agi_avg / member.agi
          end
          cp = member.cp - (cp * i)
          if i == 0
            spell = member.state?(SPELL_STATE_ID)
          else
            spell = false
          end
          @names.push([cp, member.name, spell])
        end
        i += 1
      end
    end
    #--------------------------------------------------------------------------
    # ● CTBウィンドウの中身が空かどうかを確認する
    #--------------------------------------------------------------------------
    def names_full(id)
      if @names[id] == nil
        return false
      end
      return true
    end
    end
    #==============================================================================
    # ■ Window_PartyCommand(座標がおかしくなるので、全部再定義しちゃってます)
    #==============================================================================
    class Window_PartyCommand < Window_Selectable
    #--------------------------------------------------------------------------
    # ● オブジェクト初期化(再定義)
    #--------------------------------------------------------------------------
    def initialize
      super(0, 0, 640, 64)
      self.contents = Bitmap.new(width - 32, height - 32)
      self.back_opacity = 160
      # コマンド追加
      @commands = ["Battle", "Special", "Escape"]
      @item_max = 3
      @column_max = 3
      draw_item(0, normal_color)
      draw_item(1, normal_color)   
      draw_item(2, $game_temp.battle_can_escape ? normal_color : disabled_color)
      self.active = false
      self.visible = false
      self.index = 0
    end
    #--------------------------------------------------------------------------
    # ● 項目の描画(再定義)
    #     index : 項目番号
    #     color : 文字色
    #--------------------------------------------------------------------------
    def draw_item(index, color)
      self.contents.font.color = color
      rect = Rect.new(80 + index * 160 + 4, 0, 128 - 10, 32)
      self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
      self.contents.draw_text(rect, @commands[index], 1)
    end
    #--------------------------------------------------------------------------
    # ● カーソルの矩形更新(再定義)
    #--------------------------------------------------------------------------
    def update_cursor_rect
      self.cursor_rect.set(80 + index * 160, 0, 128, 32)
    end
    end
    #==============================================================================
    # ■ Window_BattleStatus
    #==============================================================================
    class Window_BattleStatus < Window_Base
    #--------------------------------------------------------------------------
    # ● オブジェクト初期化(再定義)(微妙に座標調整)
    #--------------------------------------------------------------------------
    def initialize
      super(160, 320, 480, 160)
      self.contents = Bitmap.new(width - 32, height - 32)
      @level_up_flags = [false, false, false, false]
      refresh
    end
    #--------------------------------------------------------------------------
    # ● リフレッシュ(再定義)(微妙に座標調整)
    #--------------------------------------------------------------------------
    def refresh
      self.contents.clear
       self.contents.font.name = "Tahoma"
      self.contents.font.size = 19
      @item_max = $game_party.actors.size
      for i in 0...$game_party.actors.size
        actor = $game_party.actors[i]
        actor_x = i * 115 + 9
        draw_actor_name(actor, actor_x, 0)
        draw_actor_hp(actor, actor_x, 31, 90)
        draw_actor_sp(actor, actor_x, 65, 90)
        if @level_up_flags[i]
          self.contents.font.color = normal_color
          self.contents.draw_text(actor_x, 99, 120, 32, "Level Up!")
        else
          draw_actor_state(actor, actor_x, 99)
        end
      end
    end
    end
    
    #==============================================================================
    # ■ Game_Battler
    #==============================================================================
    class Game_Battler
    # 詠唱ステートのID読み込み
    include CTB_Define
    
    attr_accessor :now_guarding             # 現在防御中フラグ
    attr_accessor :cp                       # 現在CP
    #--------------------------------------------------------------------------
    # ● コマンド入力可能判定
    #--------------------------------------------------------------------------
    alias ctb_sys_inputable? inputable?
    def inputable?
      bool = ctb_sys_inputable?
      return false if state?(SPELL_STATE_ID)
      return false if bool == false
      return false if @cp < 500
      return true
    end
    end
    
    #==============================================================================
    # ■ Game_Actor
    #==============================================================================
    class Game_Actor < Game_Battler
    #--------------------------------------------------------------------------
    # ● セットアップ
    #--------------------------------------------------------------------------
    alias ctb_sys_setup setup
    def setup(actor_id)
      ctb_sys_setup(actor_id)
      @cp = 0
      @now_guarding = false
    end
    #--------------------------------------------------------------------------
    # ● バトル画面 X 座標の取得(再定義)
    #--------------------------------------------------------------------------
    def screen_x
      # パーティ内の並び順から X 座標を計算して返す
      if self.index != nil
        return self.index * 115 + 215
      else
        return 0
      end
    end
    end
    
    #==============================================================================
    # ■ Game_Enemy
    #==============================================================================
    class Game_Enemy < Game_Battler
    #--------------------------------------------------------------------------
    # ● オブジェクト初期化
    #--------------------------------------------------------------------------
    alias ctb_sys_initialize initialize
    def initialize(troop_id, member_index)
      ctb_sys_initialize(troop_id, member_index)
      @cp = 0
      @now_guarding = false
    end
    end
    
    #==============================================================================
    # ■ Game_BattleAction
    #==============================================================================
    class Game_BattleAction
    #--------------------------------------------------------------------------
    # ● 公開インスタンス変数
    #--------------------------------------------------------------------------
    attr_accessor :spell                    # 詠唱中か否か
    #--------------------------------------------------------------------------
    # ● オブジェクト初期化
    #--------------------------------------------------------------------------
    alias ctb_sys_initialize initialize
    def initialize
      @spell = false # spellをfalseにする
      ctb_sys_initialize
    end
    
    #--------------------------------------------------------------------------
    # ● クリア
    #--------------------------------------------------------------------------
    alias ctb_sys_clear clear
    def clear
      # spell がtrueならば実行しない
      return if @spell
      ctb_sys_clear
    end
    end
    
    #==============================================================================
    # ■ Scene_Battle
    #==============================================================================
    class Scene_Battle
    # 詠唱ステートのID読み込み
    include CTB_Define
    
    #--------------------------------------------------------------------------
    # ● メイン処理 (再定義)
    #--------------------------------------------------------------------------
    def main
      # 戦闘用の各種一時データを初期化
      $game_temp.in_battle = true
      $game_temp.battle_turn = 0
      $game_temp.battle_event_flags.clear
      $game_temp.battle_abort = false
      $game_temp.battle_main_phase = false
      $game_temp.battleback_name = $game_map.battleback_name
      $game_temp.forcing_battler = nil
      # バトルイベント用インタプリタを初期化
      $game_system.battle_interpreter.setup(nil, 0)
      # トループを準備
      @troop_id = $game_temp.battle_troop_id
      $game_troop.setup(@troop_id)  
      # アクターコマンドウィンドウを作成
      s1 = $data_system.words.attack
      s2 = $data_system.words.skill
      s3 = $data_system.words.guard
      s4 = $data_system.words.item
      @actor_command_window = Window_Command.new(115, [s1, s2, s3, s4])
      @actor_command_window.y = 160
      @actor_command_window.back_opacity = 0
      @actor_command_window.active = false
      @actor_command_window.visible = false
      # その他のウィンドウを作成
      @party_command_window = Window_PartyCommand.new
      @help_window = Window_Help.new
      @help_window.back_opacity = 0
      @help_window.visible = false
      @status_window = Window_BattleStatus.new
      @message_window = Window_Message.new
    
      ### ココから追加部分
      # 全員のすばやさの平均を割り出す
      @avg = read_avg
      # CTB用Windowを作成
      @ctb_window = Window_CTB.new(@avg)
      # 全員の初期CPを代入
      first_cp
      ### ココまで追加部分
    
      # スプライトセットを作成
      @spriteset = Spriteset_Battle.new
      # ウェイトカウントを初期化
      @wait_count = 0
      # トランジション実行
      if $data_system.battle_transition == ""
        Graphics.transition(20)
      else
        Graphics.transition(40, "Graphics/Transitions/" +
          $data_system.battle_transition)
      end
     
      # プレバトルフェーズ開始
      start_phase1
      # メインループ
      loop do
        # ゲーム画面を更新
        Graphics.update
        # 入力情報を更新
        Input.update
        # フレーム更新
        update
        # 画面が切り替わったらループを中断
        if $scene != self
          break
        end
      end
      # マップをリフレッシュ
      $game_map.refresh
      # トランジション準備
      Graphics.freeze
      # ウィンドウを解放
      @actor_command_window.dispose
      @party_command_window.dispose
      @help_window.dispose
      @status_window.dispose
      @message_window.dispose
      ### ココから追加部分
      @ctb_window.dispose
      if @skill_window != nil
        @skill_window.dispose
      end
      ### ココまで追加部分
      if @skill_window != nil
        @skill_window.dispose
      end
      if @item_window != nil
        @item_window.dispose
      end
      if @result_window != nil
        @result_window.dispose
      end
      # スプライトセットを解放
      @spriteset.dispose
      # タイトル画面に切り替え中の場合
      if $scene.is_a?(Scene_Title)
        # 画面をフェードアウト
        Graphics.transition
        Graphics.freeze
      end
      # 戦闘テストからゲームオーバー画面以外に切り替え中の場合
      if $BTEST and not $scene.is_a?(Scene_Gameover)
        $scene = nil
      end
    end
    #--------------------------------------------------------------------------
    # ● フレーム更新(再定義)
    #--------------------------------------------------------------------------
    def update
      # バトルイベント実行中の場合
      if $game_system.battle_interpreter.running?
        # インタプリタを更新
        $game_system.battle_interpreter.update
        # アクションを強制されているバトラーが存在しない場合
        if $game_temp.forcing_battler == nil
          # バトルイベントの実行が終わった場合
          unless $game_system.battle_interpreter.running?
            # 戦闘継続の場合、バトルイベントのセットアップを再実行
            unless judge
              setup_battle_event
            end
          end
          # アフターバトルフェーズでなければ
          if @phase != 5
            # ステータスウィンドウをリフレッシュ
            @status_window.refresh
          end
        end
      end
      # システム (タイマー)、画面を更新
      $game_system.update
      $game_screen.update
      # タイマーが 0 になった場合
      if $game_system.timer_working and $game_system.timer == 0
        # バトル中断
        $game_temp.battle_abort = true
      end
     
      # ココから追加
      # CP更新
      if @phase != 4
        cp_countup
      end
      @ctb_window.update
      # CTB ウィンドウに名前が表示されていない場合(戦闘開始時)はrefresh
      @ctb_window.refresh if @ctb_window.names_empty
      # ココまで追加
    
      # ウィンドウを更新
      @help_window.update
      @party_command_window.update
      @actor_command_window.update
      @status_window.update
      @message_window.update
      # スプライトセットを更新
      @spriteset.update
      # トランジション処理中の場合
      if $game_temp.transition_processing
        # トランジション処理中フラグをクリア
        $game_temp.transition_processing = false
        # トランジション実行
        if $game_temp.transition_name == ""
          Graphics.transition(20)
        else
          Graphics.transition(40, "Graphics/Transitions/" +
            $game_temp.transition_name)
        end
      end
      # メッセージウィンドウ表示中の場合
      if $game_temp.message_window_showing
        return
      end
      # エフェクト表示中の場合
      if @spriteset.effect?
        return
      end
      # ゲームオーバーの場合
      if $game_temp.gameover
        # ゲームオーバー画面に切り替え
        $scene = Scene_Gameover.new
        return
      end
      # タイトル画面に戻す場合
      if $game_temp.to_title
        # タイトル画面に切り替え
        $scene = Scene_Title.new
        return
      end
      # バトル中断の場合
      if $game_temp.battle_abort
        # バトル開始前の BGM に戻す
        $game_system.bgm_play($game_temp.map_bgm)
        # バトル終了
        battle_end(1)
        return
      end
      # ウェイト中の場合
      if @wait_count > 0
        # ウェイトカウントを減らす
        @wait_count -= 1
        return
      end
      # アクションを強制されているバトラーが存在せず、
      # かつバトルイベントが実行中の場合
      if $game_temp.forcing_battler == nil and
         $game_system.battle_interpreter.running?
        return
      end
      # フェーズによって分岐
      case @phase
      when 1  # プレバトルフェーズ
        update_phase1
      when 2  # パーティコマンドフェーズ
        update_phase2
      when 3  # アクターコマンドフェーズ
        update_phase3
      when 4  # メインフェーズ
        update_phase4
      when 5  # アフターバトルフェーズ
        update_phase5
      # ココから追加
      when 6 # 全行動順確認フェーズ(追加部分)
        update_ctb_all
      end
    end
    #--------------------------------------------------------------------------
    # ● パーティコマンドフェーズ開始(再定義)
    #--------------------------------------------------------------------------
    def start_phase2
      # フェーズ 2 に移行
      @phase = 2
      # アクターを非選択状態に設定
      @actor_index = -1
      @active_battler = nil
      # ココから変更
      # アクターコマンドウィンドウを無効化
      @actor_command_window.active = false
      @actor_command_window.visible = false
      # ココまで変更
      # メインフェーズフラグをクリア
      $game_temp.battle_main_phase = false
      # パーティ全員のアクションをクリア
      $game_party.clear_actions   
      # コマンド入力不可能な場合
      unless $game_party.inputable?
        # メインフェーズ開始
        start_phase4
      end
      # ココから変更
      # パーティーコマンドがアクティブならばパーティーコマンドフェーズへ
      if @party_command_window.active != true
        start_phase3
      else
        update_phase2
      end
      # ココまで変更
    end
    #--------------------------------------------------------------------------
    # ● フレーム更新 (パーティコマンドフェーズ)(再定義)
    #--------------------------------------------------------------------------
    def update_phase2
      # 全部変更してます
      # C ボタンが押された場合
      if Input.trigger?(Input::C)
        # パーティコマンドウィンドウのカーソル位置で分岐
        case @party_command_window.index
        when 0  # 戦う
          # 決定 SE を演奏
          $game_system.se_play($data_system.decision_se)
          # アクターコマンドフェーズ開始
          start_phase3
        when 1  # CTBWindow2
          # 決定 SE を演奏
          $game_system.se_play($data_system.decision_se)
          # CTB表示開始
          start_phase2_CTB
        when 2  # 逃げる
          # 逃走可能ではない場合
          if $game_temp.battle_can_escape == false
            # ブザー SE を演奏
            $game_system.se_play($data_system.buzzer_se)
            return
          end
          # 決定 SE を演奏
          $game_system.se_play($data_system.decision_se)
          # 逃走処理
          update_phase2_escape
        end
        return
      elsif Input.trigger?(Input::B)
        # 決定 SE を演奏
        $game_system.se_play($data_system.cancel_se)
        # アクターコマンドフェーズ開始
        start_phase3
      end
    end
    #--------------------------------------------------------------------------
    # ● フレーム更新 (パーティコマンドフェーズ : 逃げる)
    #--------------------------------------------------------------------------
    alias ctb_sys_update_phase2_escape update_phase2_escape
    def update_phase2_escape
      # CP消費 (全員)
      for actor in $game_party.actors
        if actor.exist?
          actor.cp -= CP_COST_ESCAPE * @avg / actor.agi
        end
      end
      ctb_sys_update_phase2_escape
    end
    #--------------------------------------------------------------------------
    # ● アクターコマンドウィンドウのセットアップ
    #--------------------------------------------------------------------------
    alias ctb_sys_phase3_setup_command_window phase3_setup_command_window
    def phase3_setup_command_window
      ctb_sys_phase3_setup_command_window
      # ガードフラグをfalseにする
      @active_battler.now_guarding = false
      # アクターコマンドウィンドウの位置を再設定(右へ160移動)
      @actor_command_window.x = @actor_index * 105 + 160
    end
    #--------------------------------------------------------------------------
    # ● フレーム更新 (アクターコマンドフェーズ : 基本コマンド)
    #--------------------------------------------------------------------------
    alias ctb_sys_update_phase3_basic_command update_phase3_basic_command
    def update_phase3_basic_command
      # X ボタンが押された場合
      if Input.trigger?(Input::X)
        # 決定 SE を演奏
        $game_system.se_play($data_system.decision_se)
        # パーティーコマンド呼び出し
        @party_command_window.active = true
        @party_command_window.visible = true     
        start_phase2     
      else
        ctb_sys_update_phase3_basic_command
      end
    end
    #--------------------------------------------------------------------------
    # ● 行動順序作成 (再定義)
    #--------------------------------------------------------------------------
    def make_action_orders
      # CP500以上のバトラーはpushしないようにした。
      # 配列 @action_battlers を初期化
      @action_battlers = []
      # CP500以上のエネミーを配列 @action_battlers に追加
      for enemy in $game_troop.enemies
        if enemy.cp >= 500
          @action_battlers.push(enemy)
        end
      end
      # CP500以上のアクターを配列 @action_battlers に追加
      for actor in $game_party.actors
        if actor.cp >= 500
          @action_battlers.push(actor)
        end
      end
      # 全員のアクションスピードを決定
      for battler in @action_battlers
        battler.make_action_speed
      end
      # アクションスピードの大きい順に並び替え
      @action_battlers.sort! {|a,b|
        b.current_action.speed - a.current_action.speed }
    end
    #--------------------------------------------------------------------------
    # ● フレーム更新 (メインフェーズ ステップ 1 : アクション準備)
    #--------------------------------------------------------------------------
    alias ctb_sys_update_phase4_step1 update_phase4_step1
    def update_phase4_step1
      # CTBリフレッシュ
      @ctb_window.refresh
      ctb_sys_update_phase4_step1
    end
    #--------------------------------------------------------------------------
    # ● フレーム更新 (メインフェーズ ステップ 2 : アクション開始)(再定義)
    #--------------------------------------------------------------------------
    def update_phase4_step2
      # 強制アクションでなければ
      unless @active_battler.current_action.forcing
        # 制約が [敵を通常攻撃する] か [味方を通常攻撃する] の場合
        if @active_battler.restriction == 2 or @active_battler.restriction == 3
          # アクションに攻撃を設定
          @active_battler.current_action.kind = 0
          @active_battler.current_action.basic = 0
        end
        # 制約が [行動できない] の場合
        if @active_battler.restriction == 4
          # アクション強制対象のバトラーをクリア
          $game_temp.forcing_battler = nil
          if @active_battler.cp >= 500
            # ステート自然解除
            @active_battler.remove_states_auto
            # CP消費 (行動できない場合は何もしない場合と同じ) ココ追加
            @active_battler.cp -= CP_COST_NOTHING * @avg / @active_battler.agi
            # cpをカウントアップ
            cp_countup
          end
          # ステップ 1 に移行
          @phase4_step = 1
          return
        end
      end
      # 対象バトラーをクリア
      @target_battlers = []
      # アクションの種別で分岐
      case @active_battler.current_action.kind
      when 0  # 基本
        make_basic_action_result
      when 1  # スキル
        make_skill_action_result
      when 2  # アイテム
        make_item_action_result
      end
      # ステップ 3 に移行
      if @phase4_step == 2
        @phase4_step = 3
      end
    end
    #--------------------------------------------------------------------------
    # ● 基本アクション 結果作成
    #--------------------------------------------------------------------------
    alias ctb_sys_make_basic_action_result make_basic_action_result
    def make_basic_action_result
      # 攻撃の場合
      if @active_battler.current_action.basic == 0
    @active_battler.cp -= CP_COST_ATTACK * @avg / @active_battler.agi
      end
      # 防御の場合
      if @active_battler.current_action.basic == 1
        # CP消費
        @active_battler.cp -= CP_COST_GUARD * @avg / @active_battler.agi
      end
      # 敵の逃げるの場合
      if @active_battler.is_a?(Game_Enemy) and
         @active_battler.current_action.basic == 2
        # CP消費
        @active_battler.cp -= CP_COST_ESCAPE * @avg / @active_battler.agi
      end
      # 何もしないの場合
      if @active_battler.current_action.basic == 3
        # CP消費
        @active_battler.cp -= CP_COST_NOTHING * @avg / @active_battler.agi
        # アクション強制対象のバトラーをクリア
        $game_temp.forcing_battler = nil
        # cpをカウントアップ
        cp_countup
        # ステップ 1 に移行
        @phase4_step = 1
        return
      end
      # 呼び戻し
      ctb_sys_make_basic_action_result
    end
    #--------------------------------------------------------------------------
    # ● スキルアクション 結果作成(再定義)
    #--------------------------------------------------------------------------
    def make_skill_action_result
      # スキルを取得
      @skill = $data_skills[@active_battler.current_action.skill_id]
      skill = $data_skills[@active_battler.current_action.skill_id]
      # ステータスウィンドウをリフレッシュ
      @status_window.refresh
      @ctb_window.refresh
      # ヘルプウィンドウにスキル名を表示
      @help_window.set_text(@skill.name, 1)
      # 詠唱中の場合
      if @active_battler.state?(SPELL_STATE_ID)
        # ステート「詠唱」を削除
        @active_battler.remove_state(SPELL_STATE_ID)
        @active_battler.current_action.spell = false
      else
        # SP 消費
        @active_battler.sp -= @skill.sp_cost
        # SkillのSpell値が1以上の場合
        if @skill.spell > 0
          # CP 消費 skill.spellの減算
          @active_battler.cp -= CP_COST_SKILL[skill.id] * @avg / @active_battler.agi
          # ステート「詠唱」を付
          @active_battler.add_state(SPELL_STATE_ID)
          @active_battler.current_action.spell = true
        end
      end
      # ステート「詠唱」がなければ効果実行
      unless @active_battler.state?(SPELL_STATE_ID)
        # SP 消費を戻す。
        @active_battler.sp += @skill.sp_cost
        # 強制アクションでなければ
        unless @active_battler.current_action.forcing
          # SP 切れなどで使用できなくなった場合
          unless @active_battler.skill_can_use?(@skill.id)
            # アクション強制対象のバトラーをクリア
            $game_temp.forcing_battler = nil
            # ステップ 1 に移行
            @phase4_step = 1
            return
          end
        end
        # SP をまた消費
        @active_battler.sp -= @skill.sp_cost
        # CP 消費 skill.delayの減算
        @active_battler.cp -= CP_COST_SKILL[skill.id] * @avg / @active_battler.agi
        # アニメーション ID を設定
        @animation1_id = @skill.animation1_id
        @animation2_id = @skill.animation2_id
        # コモンイベント ID を設定
        @common_event_id = @skill.common_event_id
        # 対象側バトラーを設定
        set_target_battlers(@skill.scope)
        # スキルの効果を適用
        for target in @target_battlers
          target.skill_effect(@active_battler, @skill)
               end
     end
    end
    #--------------------------------------------------------------------------
    # ● アイテムアクション 結果作成
    #--------------------------------------------------------------------------
    def make_item_action_result
    alias ctb_sys_make_item_action_result make_item_action_result
     ctb_sys_make_item_action_result
     # CP 消費
     @active_battler.cp -= CP_COST_ITEM * @avg / @active_battler.agi
    end
    #--------------------------------------------------------------------------
    # ● フレーム更新 (メインフェーズ ステップ 6 : リフレッシュ)
    #--------------------------------------------------------------------------
    alias ctb_sys_update_phase4_step6 update_phase4_step6
    def update_phase4_step6
     ctb_sys_update_phase4_step6
     # cpをカウントアップ
     cp_countup
    end
    #--------------------------------------------------------------------------
    # ● すばやさ平均割り出し
    #--------------------------------------------------------------------------
    def read_avg
     temp = 0
     for member in $game_party.actors + $game_troop.enemies
       temp += member.agi
     end
     temp /= $game_troop.enemies.size + $game_party.actors.size
     return temp
    end 
    #--------------------------------------------------------------------------
    # ● 全員の初期CPを決定
    #--------------------------------------------------------------------------
    def first_cp
     for member in $game_party.actors + $game_troop.enemies
       member.cp = [[5 * (rand(20) + 60) * member.agi / @avg, 0].max, 490].min
     end
    end
    #----------------------------------------------------------------------------
    # ● 次の行動者までCPをカウントアップ
    #----------------------------------------------------------------------------
    def cp_countup   
     # 500 - cpの最小値を読み込む
     cpmin = 500
     edead = 0
     for enemy in $game_troop.enemies
       # 行動出来なければ無視
       if enemy.dead? == true
         edead +=1
         enemy.cp = 0
         next
       end
       cpmin = [cpmin, 500 - enemy.cp].min
     end
    
     # エネミーが全員死んでいればreturn
     return if $game_troop.enemies.size == edead
    
     for actor in $game_party.actors
       # 行動出来なければ無視
       if actor.dead? == true
         actor.cp = 0
         next
       end
       cpmin = [cpmin, 500 - actor.cp].min
     end
    
     # cpminが0ならばここで処理終了
     return if cpmin <= 0
    
     # 全員のCPをcpmin加算
     for member in $game_party.actors + $game_troop.enemies
       # 行動出来なければ無視
       next if member.dead?
       member.cp += cpmin
       # cpが500より小さければ次へ
       next if member.cp < 500
       # ステート自然解除
       member.remove_states_auto
       # MP回復
       plus = [member.maxsp * 5/ 100,1].max
       member.sp = [member.sp + plus,member.maxsp].min
       if member.slip_damage?
         # スリップダメージ
         member.slip_damage_effect
         member.damage_pop = true
       end
     end
     @status_window.refresh
    end
    #--------------------------------------------------------------------------
    # ● フレーム更新 (パーティコマンドフェーズ : 行動順表示)
    #--------------------------------------------------------------------------
    def start_phase2_CTB
     @party_command_window.active = false
     @party_command_window.visible = false
     # フェーズ 6 に移行
     @phase = 6
     @ctb_window.visible = false
     @ctb_window_all = Window_CTB_All.new(@avg)
     @ctb_window_all.update
     @id = 1
     @ctb_window_all.refresh(@id)
    end 
    #--------------------------------------------------------------------------
    # ● フレーム更新 (パーティコマンドフェーズ : 行動順アップデート)
    #--------------------------------------------------------------------------
    def update_ctb_all
     # 下 ボタンが押された場合
     if Input.trigger?(Input::DOWN) or Input.repeat?(Input::DOWN)
       if @id < 50
         @id +=1
       else
         @id = 1
       end
       @ctb_window_all.refresh(@id)
     # 上 ボタンが押された場合     
     elsif Input.trigger?(Input::UP) or Input.repeat?(Input::UP)
       if @id > 1
         @id -= 1
       else
         @id = 50
       end
       @ctb_window_all.refresh(@id)
     # L ボタンが押された場合     
     elsif Input.trigger?(Input::L)
       @id = [@id-18,1].max
       @ctb_window_all.refresh(@id)
     # R ボタンが押された場合     
     elsif Input.trigger?(Input::R)
       @id = [@id+18, 50].min
       @ctb_window_all.refresh(@id)
     # BかAが押されたら
     elsif Input.trigger?(Input::B)
       # キャンセル SE を演奏
       $game_system.se_play($data_system.cancel_se)
       @ctb_window.visible = true
       @ctb_window_all.dispose
       @party_command_window.active = true
       @party_command_window.visible = true     
       start_phase2     
     end
    end
    end

     

     

    http://img511.imageshack.us/img511/8839/screendg5.png

     

    piccola spiegazione

     

    naturalmente se lo fai da solo è meglio ed è piu appagante

  7. script da inserire:

     

    view range

     

    #======================================================================

    ========

    # ** View Range Module

    #==============================================================================

    # Near Fantastica

    # Version 4

    # 29.11.05

    #==============================================================================

    module VR

    #----------------------------------------------------------------------------

    def VR.in_range?(element, object, range)

    x = (element.x - object.x) * (element.x - object.x)

    y = (element.y - object.y) * (element.y - object.y)

    r = x + y

    if r <= (range * range)

    return true

    else

    return false

    end

    end

    #----------------------------------------------------------------------------

    def VR.range(element, object)

    x = (element.x - object.x) * (element.x - object.x)

    y = (element.y - object.y) * (element.y - object.y)

    r = x + y

    r = Math.sqrt®

    return r.to_i

    end

    end

     

    #==============================================================================

    class Interpreter

    #----------------------------------------------------------------------------

    def event

    return $game_map.events[@event_id]

    end

    end

     

     

    encounter control

     

    #======================================================================

    ========

    # ** Encounter Control

    #------------------------------------------------------------------------------

    # SephirothSpawn

    # Version 1.01

    # 2006-10-23

    #------------------------------------------------------------------------------

    # * Version History :

    #

    # Version 1 ---------------------------------------------------- (2006-08-12)

    # Version 1.01 ------------------------------------------------ (2006-10-23)

    # - Bug Fix : Fixed Erase Event

    #------------------------------------------------------------------------------

    # * Requirements :

    #

    # Near Fantastica's View Range Module

    #------------------------------------------------------------------------------

    # * Description :

    #

    # This script was designed to give you more control of Random Encounters

    # Encounter Control allows you give terrain tags, circular regions and

    # rectangular regions groups of enemies, instead of just map encounters.

    # Additionally, it allows you to view in the debugger the regions on the map

    #------------------------------------------------------------------------------

    # * Instructions :

    #

    #

    # Setting Up Terrain Groups (Game_Map::Terrain_Tag_Groups)

    # TTG = { map_id => { terrain_tag => [troop_id, ...], ... }, ... }

    # (Use 0 for map_id as a default for all maps, unless specified)

    #

    # Setting Up Encounter Regions

    # Adds a Comment Line with this format:

    # Comment : Enc Ctrl <type>(<params>)[group_id, ...]

    #

    # <type> = Circ (Circluar Region) or Rect (Rectangular Region)

    # Circular <params> = center_x, center_y, radius

    # Rectangular <params> = upper_left_x, upper_left_y, rect_width, rect_height

    #------------------------------------------------------------------------------

    # * Credits :

    #

    # Thanks to Near Fantastica For His View Range Module

    #==============================================================================

     

    #==============================================================================

    # ** View Range Module Extension

    #==============================================================================

     

    module VR

    #--------------------------------------------------------------------------

    # * In Rect Range?

    #--------------------------------------------------------------------------

    def self.in_rect_range?(rect, object)

    return object.x.between?(rect.x, rect.x + rect.width) &&

    object.y.between?(rect.y, rect.y + rect.height)

    end

    end

     

    #==============================================================================

    # ** Circle

    #==============================================================================

     

    class Circle

    #--------------------------------------------------------------------------

    # * Public Instance Variables

    #--------------------------------------------------------------------------

    attr_accessor :x

    attr_accessor :y

    attr_accessor :radius

    #--------------------------------------------------------------------------

    # * Object Initialization

    #--------------------------------------------------------------------------

    def initialize(x, y, r)

    @x, @y, @radius = x, y, r

    end

    end

     

    #==============================================================================

    # ** Color

    #==============================================================================

     

    class Color

    #--------------------------------------------------------------------------

    # * To Hexidecimal

    #--------------------------------------------------------------------------

    def to_hex

    n = (self.red.to_i * 100) + (self.green.to_i * 10) + self.blue.to_i

    return eval "0x#{n.to_s(16)}"

    end

    end

     

    #==============================================================================

    # ** Game_Event

    #==============================================================================

     

    class Game_Event < Game_Character

    #--------------------------------------------------------------------------

    # * Circle Encounter Areas

    #--------------------------------------------------------------------------

    def seph_circle_enconter_areas

    # Starts Enc Areas

    enc_areas = {}

    # Return Enc Areas If No List

    return enc_areas if @list.nil? || @erased

    # Checks All Event Commands

    for i in 0...@list.size

    # Checks For Comment Line

    if @list.code == 108

    # If Parameters Include 'Enc Ctrl'

    if @list.parameters[0].upcase.include?('ENC CTRL')

    # Collect Encounter List For Area

    @list.parameters[0].dup.gsub(/\[(.+?)\]/, '')

    list = $1.split.collect! {|x| x.to_i}

    # Test For Circular Range

    if @list.parameters[0].upcase.include?('CIRC')

    @list.parameters[0].dup.gsub(/\((.+?)\)/, '')

    unless $1.nil?

    circ = eval "Circle.new(#{$1})"

    # Stores Enc List

    enc_areas[circ] = list

    end

    end

    end

    end

    end

    # Return Encounter List

    return enc_areas

    end

    #--------------------------------------------------------------------------

    # * Rect Encounter Areas

    #--------------------------------------------------------------------------

    def seph_rect_encounter_areas

    # Starts Enc Areas

    enc_areas = {}

    # Return Enc Areas If No List

    return enc_areas if @list.nil?

    # Checks All Event Commands

    for i in 0...@list.size

    # Checks For Comment Line

    if @list.code == 108

    # If Parameters Include 'Enc Ctrl'

    if @list.parameters[0].upcase.include?('ENC CTRL')

    # Collect Encounter List For Area

    @list.parameters[0].dup.gsub(/\[(.+?)\]/, '')

    list = $1.split.collect! {|x| x.to_i}

    # Test For Rect Boundaries

    if @list.parameters[0].upcase.include?('RECT')

    @list.parameters[0].dup.gsub(/\((.+?)\)/, '')

    unless $1.nil?

    rect = eval "Rect.new(#{$1})"

    # Stores Enc List

    enc_areas[rect] = list

    end

    end

    end

    end

    end

    # Return Encounter List

    return enc_areas

    end

    end

     

     

    #==============================================================================

    # ** Game_Map

    #==============================================================================

     

    class Game_Map

    #--------------------------------------------------------------------------

    # * Terrain Tags

    # ~ map_id = > {terrain_tag => [troop_id, ...] }

    # * Use 0 For Default For All Maps

    # * To Overwrite Default, Include Map ID And Define or Leave Blank Terrain

    #--------------------------------------------------------------------------

    Terrain_Tag_Groups = {

    0 => {

    }

    }

    #--------------------------------------------------------------------------

    # * Alias Listings

    #--------------------------------------------------------------------------

    alias seph_enccntrl_gmmap_el encounter_list

    #--------------------------------------------------------------------------

    # * Get Encounter List

    #--------------------------------------------------------------------------

    def encounter_list

    # Checks Terrain Tag Groups

    if Terrain_Tag_Groups.has_key?(@map_id)

    # Test For Player Terrain Tag

    if Terrain_Tag_Groups[@map_id].has_key?($game_player.terrain_tag)

    # Return List

    return Terrain_Tag_Groups[@map_id][$game_player.terrain_tag]

    end

    # Checks For Default

    elsif Terrain_Tag_Groups[0].has_key?($game_player.terrain_tag)

    # Return List

    return Terrain_Tag_Groups[0][$game_player.terrain_tag]

    end

    # Checks All Events

    for event in $game_map.events.values

    # Checks Circular Ranges Of Event

    circ_ranges = event.seph_circle_enconter_areas

    circ_ranges.each do |circle, list|

    # If Player In Range of Circle

    if VR.in_range?(circle, $game_player, circle.radius)

    # Return List

    return list

    end

    end

    # Checks Rect Ranges

    rect_ranges = event.seph_rect_encounter_areas

    rect_ranges.each do |rect, list|

    # If Player In Range of Rect

    if VR.in_rect_range?(rect, $game_player)

    # Return List

    return list

    end

    end

    end

    # Return Original Encounter List

    return seph_enccntrl_gmmap_el

    end

    end

     

    #==============================================================================

    # ** Spriteset_Map

    #==============================================================================

     

    class Spriteset_Map

    #--------------------------------------------------------------------------

    # * Alias Listings

    #--------------------------------------------------------------------------

    alias seph_encctrl_gmmap_init initialize

    alias seph_encctrl_gmmap_update update

    #--------------------------------------------------------------------------

    # * Object Initialization

    #--------------------------------------------------------------------------

    def initialize

    # Original Initialization

    seph_encctrl_gmmap_init

    # Creates Flash Data Table & Flash Tile Flag

    @tilemap.flash_data = Table.new($game_map.width, $game_map.height)

    @seph_encctrl_tilesflashing = false

    end

    #--------------------------------------------------------------------------

    # * Frame Update

    #--------------------------------------------------------------------------

    def update

    # Original Update

    seph_encctrl_gmmap_update

    # If Debugging

    if $DEBUG

    # If A Button Is Pressed

    if Input.trigger?(Input::A)

    # If Tiles Flashing

    if @seph_encctrl_tilesflashing

    # Unflashes All Map Tiles

    for x in 0...$game_map.width

    for y in 0...$game_map.height

    @tilemap.flash_data[x, y] = 0

    end

    end

    # Turns Flashing Flag Off

    @seph_encctrl_tilesflashing = false

    # If Tiles Not Flashing

    else

    # Sets Up Colors Array (To Prevent Matching Colors

    @flashtile_colors = []

    # Checks All Events

    for event in $game_map.events.values

    # Flashes All Circular Ranges

    event.seph_circle_enconter_areas.keys.each do |circle|

    seph_flash_circular_range(circle, circle.radius)

    end

    # Flashes All Rect Ranges

    event.seph_rect_encounter_areas.keys.each do |rect|

    seph_flash_rect_range(rect)

    end

    # Turns Flashing Flag On

    @seph_encctrl_tilesflashing = true

    end

    end

    end

    end

    end

    #--------------------------------------------------------------------------

    # * Flash Circular Range

    #--------------------------------------------------------------------------

    def seph_flash_circular_range(object, range)

    # Gets Flash Color

    color = get_random_color while color.nil? ||

    @flashtile_colors.include?(color)

    # Flashes Tiles Within Range

    x = object.x

    for i in (x - range)..(x + range)

    sa = (x - i).abs

    x_ = i < x ? x - sa : i == x ? x : x + sa

    y_ = Integer((range ** 2 - sa ** 2) ** 0.5)

    for j in (object.y - y_)..(object.y + y_)

    @tilemap.flash_data[i, j] = color.to_hex

    end

    end

    end

    #--------------------------------------------------------------------------

    # * Flash Rect Range

    #--------------------------------------------------------------------------

    def seph_flash_rect_range(rect)

    color = get_random_color while color.nil? ||

    @flashtile_colors.include?(color)

    for x in 0...rect.width

    for y in 0...rect.height

    @tilemap.flash_data[rect.x + x, rect.y + y] = color.to_hex

    end

    end

    end

    #--------------------------------------------------------------------------

    # * Get Random Color

    #--------------------------------------------------------------------------

    def get_random_color

    return Color.new(rand(18) * 15, rand(18) * 15, rand(18) * 15)

    end

    end

     

     

    le istruzioni stanno all interno dell encounter control cmq posto lo stesso una demo

    durante il play test premendo il tasto shift vengono visualizzate le aree create con lo script

     

    p.s. ho tolto l SDK dai script

     

    Project6.zip

  8. class Bitmap
    
    def draw_cerchio(x, y, a, b, color)	
      0.step(Math::PI*2, 0.005){ |t|
     _x = a * Math.cos(t)
     _y = b * Math.sin(t)
     set_pixel(x+_x, y+_y, color)
      }  
    end

    oppure

     

     

    class Bitmap

     

    include Math

     

    def draw_cerchio(x, y, a, b, color)

    0.step(PI*2, 0.005){ |t|

    _x = a * cos(t)

    _y = b * sin(t)

    set_pixel(x+_x, y+_y, color)

    }

    end

     

     

     

    questa è la sintassi corretta. Per afarlo funzionare dopo che hai creato uno sprite con la relativa bitmap devi solo richiamare il metodo cosi

     

    @abc = Sprite.new
    @abc.bitmap = Bitmap.new(640, 480)
    @abc.bitmap.draw_cerchio(300, 107, 50, 100, Color.new(120, 200, 5)) # 50 e 100 sono i raggi dell ellisse

     

    oppure

     

    @abc.bitmap.draw_cerchio(300, 107, 50, 50, Color.new(120, 200, 5)) # per un cerchio

     

    in questo modo disegni solo il perimetro per colorarlo dentro (credo sia il tuo obbiettivo) prova a fare

     

    for i in 0..99 # semiasse maggiore 100 in questo caso
    @abc.bitmap.draw_cerchio(320, 410, 100 - i, 70-((i*70)/100), color)
    end

     

    dovrebbe andare pero facendo questo procedimento all asse minore il disegno viene strano :) con i cerchi basta diminuire di uno a e b

  9. "non parte" è un po generico... ti da errore o non si sente il suono? Hai tolto e [\b]? non so perche ma non mi funziona il grassetto mah...

     

    Nel caso continua a non partire ti posto la demo

     

    Edit: anzi ecco la demo

    mostro.zip

  10. Dentro Sprite_Battler cerca questa parte e inserisci la parte in grassetto in questo modo ogni mostro ha il suo suono. I suoni devono avere il nome del mostro nel database

     

    # Collapse
    if @battler.damage == nil and @battler.dead?
     if @battler.is_a?(Game_Enemy)
    [b]$data_system.enemy_collapse_se.name = @battler.name[/b]
    $game_system.se_play($data_system.enemy_collapse_se)
     else
    $game_system.se_play($data_system.actor_collapse_se)
     end
     collapse
     @battler_visible = false
    end

×
×
  • Create New...