查看: 1214|回复: 3

[已经过期] 【新人的无知】福利?XP45度求转码

[复制链接]
梦石
0
星屑
50
在线时间
36 小时
注册时间
2013-11-17
回帖
41
发表于 2014-2-15 11:35:26 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有账号?注册会员

×
XP用45度求转为VA格式









  1. #超级横版战斗

  2. module RPG
  3.   class Class
  4.     def name
  5.       name = @name.split(/,/)[0]
  6.       return name != nil ? name : ''
  7.     end
  8.     def name2
  9.       name = @name.split(/,/)[1]
  10.       return name != nil ? name : ''
  11.    end
  12.   end
  13.   class Weapon
  14.     def name
  15.       name = @name.split(/,/)[0]
  16.       return name != nil ? name : ''
  17.     end
  18.     def name2
  19.       name = @name.split(/,/)[1]
  20.       return name != nil ? name : ''
  21.     end   
  22.   end  
  23. end

  24. class Game_Actor
  25.   #--------------------------------------------------------------------------
  26.   # ● 更改名称
  27.   #     name : 新的名称
  28.   #--------------------------------------------------------------------------
  29.   def picturephase
  30.     name = $data_classes[class_id].name2
  31.     return name != nil ? name : "66RPG"
  32.   end
  33. end

  34. class Game_Enemy
  35.   #--------------------------------------------------------------------------
  36.   # ● 获取名称
  37.   #--------------------------------------------------------------------------
  38.   def name
  39.     name = $data_enemies[@enemy_id].name.split(/,/)[0]
  40.     return name != nil ? name : ''
  41.   end
  42.   def picturephase
  43.     name = $data_enemies[@enemy_id].name.split(/,/)[1]
  44.     return name != nil ? name : "66RPG"
  45.   end  
  46. end

  47. class Animated_Sprite < RPG::Sprite
  48. #--------------------------------------------------------------------------
  49. # - Accessible instance variables.
  50. #--------------------------------------------------------------------------
  51. attr_accessor :frames        # Number of animation frames
  52. attr_accessor :delay         # Delay time between frames (speed)
  53. attr_accessor :frame_width   # Width of each frame
  54. attr_accessor :frame_height  # Height of each frame
  55. attr_accessor :offset_x      # X coordinate of the 1st frame
  56. attr_accessor :offset_y      # Y coordinate of all frames
  57. attr_accessor :current_frame # Current animation frame
  58. attr_accessor :moving        # Is the sprite moving?

  59. def initialize(viewport = nil)
  60.    super(viewport)
  61.    @frame_width, @frame_height = 0, 0
  62.    change    # A basic change to set initial variables
  63.    @old = Graphics.frame_count  # For the delay method
  64.    @goingup = true    # Increasing animation? (if @rm2k_mode is true)
  65.    @once = false      # Is the animation only played once?
  66.    @animated = true   # Used to stop animation when @once is true
  67. end

  68. def change(frames = 0, delay = 0, offx = 0, offy = 0,
  69.             startf = 0, once = false)
  70.    @frames = frames
  71.    @delay = delay
  72.    @offset_x, @offset_y = offx, offy
  73.    @current_frame = startf
  74.    @once = once
  75.    x = @current_frame * @frame_width + @offset_x
  76.    self.src_rect = Rect.new(x, @offset_y, @frame_width, @frame_height)
  77.    @goingup = true
  78.    @animated = true
  79. end

  80. def update
  81.    super
  82.    if self.bitmap != nil and delay(@delay) and @animated
  83.      x = @current_frame * @frame_width + @offset_x
  84.      self.src_rect = Rect.new(x, @offset_y, @frame_width, @frame_height)
  85.        @current_frame = (@current_frame + 1) unless @frames == 0
  86.        @animated = false if @current_frame == @frames and @once
  87.        @current_frame %= @frames
  88.    end
  89. end

  90. def move(x, y, speed = 1, delay = 0)
  91.    @destx = x
  92.    @desty = y
  93.    @move_speed = speed
  94.    @move_delay = delay
  95.    @move_old = Graphics.frame_count
  96.    @moving = true
  97. end
  98.   
  99. #--------------------------------------------------------------------------
  100. # - Move sprite to destx and desty
  101. #--------------------------------------------------------------------------
  102. def update_move
  103.    return unless @moving
  104.    movinc = @move_speed == 0 ? 1 : @move_speed
  105.    if Graphics.frame_count - @move_old > @move_delay or @move_speed != 0
  106.      self.x += movinc if self.x < @destx
  107.      self.x -= movinc if self.x > @destx
  108.      self.y += movinc if self.y < @desty
  109.      self.y -= movinc if self.y > @desty
  110.      self.z = self.y
  111.      @move_old = Graphics.frame_count
  112.    end
  113.    if @move_speed > 1  # Check if sprite can't reach that point
  114.      self.x = @destx if (@destx - self.x).abs % @move_speed != 0 and
  115.                         (@destx - self.x).abs <= @move_speed
  116.      self.y = @desty if (@desty - self.y).abs % @move_speed != 0 and
  117.                         (@desty - self.y).abs <= @move_speed
  118.    end
  119.    if self.x == @destx and self.y == @desty
  120.      @moving = false
  121.    end
  122. end
  123.   
  124. def delay(frames)
  125.    update_move
  126.    if (Graphics.frame_count - @old >= frames)
  127.      @old = Graphics.frame_count
  128.      return true
  129.    end
  130.    return false
  131. end
  132. end

  133. class Game_Actor < Game_Battler
  134. def screen_x
  135.     # 返回计算后的队伍 X 坐标的排列顺序
  136.    case self.index
  137.     when 0
  138.       return 300
  139.     when 1
  140.       return 395
  141.     when 2
  142.       return 490
  143.     when 3
  144.       return 580
  145.     else
  146.       return 1000
  147.     end
  148.   end   

  149. def screen_y
  150.    case self.index
  151.     when 0
  152.       return 380
  153.     when 1
  154.       return 340
  155.     when 2
  156.       return 300
  157.     when 3
  158.       return 250
  159.     else
  160.       return 1000
  161.     end
  162.   end
  163. def screen_z
  164.     # 返回计算后的队伍 Z 坐标的排列顺序
  165.     if self.index != nil
  166.       return 104 - self.index
  167.     else
  168.       return 0
  169.     end
  170.   end
  171. end

  172. # RPG's snipplet...
  173. class Spriteset_Battle
  174. attr_accessor :actor_sprites
  175. attr_accessor :enemy_sprites
  176.   
  177.   
  178. alias original_initialize initialize
  179. def initialize
  180.    #@start_party_number = $game_party.actors.size
  181.    # ビューポートを作成
  182.    @viewport0 = Viewport.new(0, 0, 640, 480)
  183.    @viewport1 = Viewport.new(0, 0, 640, 480)
  184.    @viewport2 = Viewport.new(0, 0, 640, 480)
  185.    @viewport3 = Viewport.new(0, 0, 640, 480)
  186.    @viewport4 = Viewport.new(0, 0, 640, 480)
  187.    @viewport1.z = 50
  188.    @viewport2.z = 50
  189.    @viewport3.z = 200
  190.    @viewport4.z = 5000

  191.    @battleback_sprite = Sprite.new(@viewport0)
  192.    
  193.    @enemy_sprites = []
  194.    for enemy in $game_troop.enemies #.reverse
  195.      @enemy_sprites.push(Sprite_Battler.new(@viewport1, enemy))
  196.    end
  197.    
  198.    @actor_sprites = []
  199.    @actor_sprites.push(Sprite_Battler.new(@viewport2,$game_party.actors[0]))
  200.    @actor_sprites.push(Sprite_Battler.new(@viewport2,$game_party.actors[1]))
  201.    @actor_sprites.push(Sprite_Battler.new(@viewport2,$game_party.actors[2]))
  202.    @actor_sprites.push(Sprite_Battler.new(@viewport2,$game_party.actors[3]))
  203.    
  204.    @weather = RPG::Weather.new(@viewport1)
  205.    @picture_sprites = []
  206.    for i in 51..100
  207.      @picture_sprites.push(Sprite_Picture.new(@viewport3,
  208.        $game_screen.pictures[i]))
  209.    end
  210.    @timer_sprite = Sprite_Timer.new
  211.    update
  212. end
  213.   
  214.   
  215.   
  216. alias original_update update
  217. def update
  218.    @viewport1.z = 50 and @viewport2.z = 51 #if $actor_on_top == true
  219. #  @viewport1.z = 51 and @viewport2.z = 50 if $actor_on_top == false
  220.     # 刷新角色的活动块 (对应角色的替换)
  221.     @actor_sprites[0].battler = $game_party.actors[0]
  222.     @actor_sprites[1].battler = $game_party.actors[1]
  223.     @actor_sprites[2].battler = $game_party.actors[2]
  224.     @actor_sprites[3].battler = $game_party.actors[3]
  225.     # 战斗背景的文件名与现在情况有差异的情况下
  226.     if @battleback_name != $game_temp.battleback_name
  227.       @battleback_name = $game_temp.battleback_name
  228.       if @battleback_sprite.bitmap != nil
  229.         @battleback_sprite.bitmap.dispose
  230.       end
  231.       @battleback_sprite.bitmap = RPG::Cache.battleback(@battleback_name)
  232.       @battleback_sprite.src_rect.set(0, 0, 640, 480)
  233.     end
  234.     # 刷新战斗者的活动块
  235.     for sprite in @enemy_sprites + @actor_sprites
  236.       sprite.update
  237.     end
  238.     # 刷新天气图形
  239.     @weather.type = $game_screen.weather_type
  240.     @weather.max = $game_screen.weather_max
  241.     @weather.update
  242.     # 刷新图片活动块
  243.     for sprite in @picture_sprites
  244.       sprite.update
  245.     end
  246.     # 刷新计时器活动块
  247.     @timer_sprite.update
  248.     # 设置画面的色调与震动位置
  249.     @viewport1.tone = $game_screen.tone
  250.     @viewport1.ox = $game_screen.shake
  251.     # 设置画面的闪烁色
  252.     @viewport4.color = $game_screen.flash_color
  253.     # 刷新显示端口
  254.     @viewport1.update
  255.     @viewport2.update
  256.     @viewport4.update
  257. end
  258. end

  259. class Sprite_Battler < Animated_Sprite

  260. attr_accessor :battler
  261. attr_reader   :index
  262. attr_accessor :target_index
  263. attr_accessor :frame_width
  264. def initialize(viewport, battler = nil)
  265.    super(viewport)
  266.    [url=home.php?mod=space&uid=133701]@battler[/url] = battler
  267.    @pattern_b = 0 #
  268.    @counter_b = 0 #
  269.    [url=home.php?mod=space&uid=370741]@Index[/url] = 0     #
  270.    if @battler != nil
  271.      tempbitmap = RPG::Cache.battler(@battler.battler_name, @battler.battler_hue)
  272.      @frame_width = tempbitmap.width/4
  273.      picturephase = @battler.picturephase
  274.         @frame_height = tempbitmap.height/8
  275.    else
  276.      @frame_width, @frame_height = 1,1
  277.    end   
  278.    # start sprite
  279.    @battler.is_a?(Game_Enemy) ? enemy_pose(1) : pose(1)
  280.    @battler_visible = false
  281.    if $target_index == nil
  282.      $target_index = 0
  283.    end
  284. end
  285.   
  286. def index=(index) #
  287.    @index = index  #
  288.    update          #
  289. end               #
  290.   
  291. def dispose
  292.    if self.bitmap != nil
  293.      self.bitmap.dispose
  294.    end
  295.    super
  296. end
  297.   
  298. def enemy                                             #
  299.    $target_index += $game_troop.enemies.size
  300.    $target_index %= $game_troop.enemies.size
  301.    return $game_troop.enemies[$target_index]           #
  302. end                                                   #
  303.   
  304. def actor                                             #
  305.    $target_index += $game_party.actors.size
  306.    $target_index %= $game_party.actors.size
  307.    return $game_party.actors[$target_index]            #
  308. end            

  309. def pose(number, frames = 4)
  310.     case number
  311.     when 0  # run
  312.     change(frames, 5, 0, 0, 0)
  313.     when 1  # standby
  314.     change(frames, 5, 0, @frame_height)
  315.     when 2 # defend
  316.     change(frames, 5, 0, @frame_height * 2)
  317.     when 3 # Hurt, loops
  318.     change(frames, 5, 0, @frame_height * 3)
  319.     when 4 # attack no loop
  320.     change(frames, 5, 0, @frame_height * 4, 0, true)
  321.     when 5 # skill
  322.     change(frames, 5, 0, @frame_height * 5)
  323.     when 6 # death
  324.     change(frames, 5, 0, @frame_height * 6)
  325.     when 7 # winning pose
  326.     change(frames, 5, 0, @frame_height * 7)
  327.     when 8 # no sprite
  328.     change(frames, 5, 0, @frame_height * 8)
  329.     when 9 # no sprite
  330.     change(frames, 5, 0, @frame_height * 9)
  331.     when 10 # no sprite
  332.     change(frames, 5, 0, @frame_height * 10)
  333.     when 11 # no sprite
  334.     change(frames, 5, 0, @frame_height * 11)
  335.     when 12 # no sprite
  336.     change(frames, 5, 0, @frame_height * 12)
  337.     when 13 # no sprite
  338.     change(frames, 5, 0, @frame_height * 13)
  339.     when 14 # no sprite
  340.     change(frames, 5, 0, @frame_height * 14)
  341.     when 15 # no sprite
  342.     change(frames, 5, 0, @frame_height * 15)
  343.     when 16 # no sprite
  344.     change(frames, 5, 0, @frame_height * 16)
  345.     when 17 # no sprite
  346.     change(frames, 5, 0, @frame_height * 17)
  347.     when 18 # no sprite
  348.     change(frames, 5, 0, @frame_height * 18)
  349.     when 19 # no sprite
  350.     change(frames, 5, 0, @frame_height * 19)
  351.     when 20 # no sprite
  352.     change(frames, 5, 0, @frame_height * 20)
  353.     # ...etc.
  354.    else
  355.      change(frames, 5, 0, @frame_height * number, 0)
  356.    end
  357. end
  358.   
  359. #--------------------------------------------------------------------------
  360. # - Change the battle pose for an enemy
  361. #   number : pose' number
  362. #--------------------------------------------------------------------------
  363. def enemy_pose(number ,enemy_frames = 4)
  364.    case number
  365.    when 0  # 前进
  366.      change(enemy_frames, 5, 0, 0, 0)
  367.    when 1  # 等待
  368.      change(enemy_frames, 5, 0, @frame_height)
  369.    when 2 # 防御
  370.      change(enemy_frames, 5, 0, @frame_height * 2)
  371.    when 3 # 挨打
  372.      change(enemy_frames, 5, 0, @frame_height * 3)
  373.    when 4 # 物理攻击
  374.      change(enemy_frames, 5, 0, @frame_height * 4, 0, true)
  375.    when 5 # 法术
  376.      change(enemy_frames, 5, 0, @frame_height * 5)
  377.    when 6 # 死亡
  378.      change(enemy_frames, 5, 0, @frame_height * 6)
  379.    when 7 # 胜利待机
  380.      change(enemy_frames, 5, 0, @frame_height * 7)
  381.      # ...etc.
  382.    else
  383.      change(enemy_frames, 5, 0, @frame_height * number, 0)
  384.    end
  385. end
  386. #==============================================================================
  387. # sniplet end...
  388. #==============================================================================  
  389.   
  390.   def update
  391.    super
  392.    
  393.    if @battler == nil                                                      
  394.      self.bitmap = nil                                                      
  395.      loop_animation(nil)                                                   
  396.      return                                                               
  397.    end                                                                     
  398.    if @battler.battler_name != @battler_name or
  399.       @battler.battler_hue != @battler_hue

  400.      @battler_name = @battler.battler_name
  401.      @battler_hue = @battler.battler_hue
  402.      self.bitmap = RPG::Cache.battler(@battler_name, @battler_hue)
  403.      @width = bitmap.width
  404.      [url=home.php?mod=space&uid=291977]@height[/url] = bitmap.height
  405.      self.ox = @frame_width / 2
  406.      self.oy = @frame_height
  407.      
  408.      if @battler.dead? or @battler.hidden
  409.        self.opacity = 0
  410.      end   
  411.      self.x =  @battler.screen_x
  412.      self.y =  @battler.screen_y
  413.      self.z =  @battler.screen_z
  414.    end

  415.    if @battler.damage == nil and
  416.       @battler.state_animation_id != @state_animation_id
  417.      @state_animation_id = @battler.state_animation_id
  418.      loop_animation($data_animations[@state_animation_id])
  419.    end

  420.    if @battler.is_a?(Game_Actor) and @battler_visible
  421.      if $game_temp.battle_main_phase
  422.        self.opacity += 3 if self.opacity < 255
  423.      else
  424.        self.opacity -= 3 if self.opacity > 207
  425.      end
  426.    end
  427.    
  428.      if battler.state?(51)
  429.        self.opacity = 100
  430.      end  


  431.    if @battler.blink
  432.      blink_on
  433.    else
  434.      blink_off
  435.    end

  436.    unless @battler_visible
  437.      if not @battler.hidden and not @battler.dead? and
  438.         (@battler.damage == nil or @battler.damage_pop)
  439.        appear
  440.        @battler_visible = true
  441.      end
  442.      if not @battler.hidden and
  443.         (@battler.damage == nil or @battler.damage_pop) and
  444.         @battler.is_a?(Game_Actor)
  445.        appear
  446.        @battler_visible = true
  447.      end
  448.    end
  449.    if @battler_visible
  450.      if @battler.hidden
  451.        $game_system.se_play($data_system.escape_se)
  452.        escape
  453.        @battler_visible = false
  454.      end
  455.      if @battler.white_flash
  456.        whiten
  457.        @battler.white_flash = false
  458.      end
  459.      if @battler.animation_id != 0
  460.        animation = $data_animations[@battler.animation_id]
  461.        animation(animation, @battler.animation_hit)
  462.        @battler.animation_id = 0
  463.      end
  464.      if @battler.damage_pop
  465.        damage(@battler.damage, @battler.critical)
  466.        @battler.damage = nil
  467.        @battler.critical = false
  468.        @battler.damage_pop = false
  469.      end
  470.      if @battler.damage == nil and @battler.dead?
  471.        if @battler.is_a?(Game_Enemy)
  472.          $game_system.se_play($data_system.enemy_collapse_se)
  473.          collapse
  474.          @battler_visible = false
  475.        #定义的角色死亡音效
  476.         else
  477.          case @battler.id        
  478.            when 1
  479.            Audio.se_play("Audio/SE/"+"X-01-女-死亡",90,100) unless @dead
  480.            when 2
  481.            Audio.se_play("Audio/SE/"+"Y-01-男-死亡",90,100) unless @dead
  482.            when 3
  483.            Audio.se_play("Audio/SE/"+"X-02-女-死亡",90,100) unless @dead
  484.            when 4
  485.            Audio.se_play("Audio/SE/"+"Y-02-男-死亡",90,100) unless @dead
  486.            when 5
  487.            Audio.se_play("Audio/SE/"+"X-03-女-死亡",90,100) unless @dead
  488.            when 6
  489.            Audio.se_play("Audio/SE/"+"Y-03-男-死亡",90,100) unless @dead
  490.            when 7
  491.            Audio.se_play("Audio/SE/"+"7",90,100) unless @dead
  492.            when 8
  493.            Audio.se_play("Audio/SE/"+"8",90,100) unless @dead
  494.            when 9
  495.            Audio.se_play("Audio/SE/"+"9",90,100) unless @dead
  496.          end
  497.           @dead = true
  498.           pose(6)
  499.         end
  500.      else
  501.        @dead = false
  502.      end
  503.    end                                                                #
  504. end
  505. end
  506. #==============================================================================
  507. # Scene_Battle Costum  Battle System
  508. #==============================================================================
  509. class Scene_Battle
  510. def update_phase4
  511.    case @phase4_step
  512.    when 1
  513.      update_phase4_step1
  514.    when 2
  515.      update_phase4_step2
  516.    when 3
  517.      update_phase4_step3
  518.    when 4
  519.      update_phase4_step4
  520.    when 5
  521.      update_phase4_step5
  522.    when 6
  523.      update_phase4_step6
  524.    when 7
  525.      update_phase4_step7
  526.    when 8
  527.     update_phase4_step8   
  528.    end
  529. end

  530. def make_basic_action_result
  531.    if @active_battler.is_a?(Game_Actor)
  532.      $actor_on_top = true
  533.    elsif @active_battler.is_a?(Game_Enemy)
  534.      $actor_on_top = false
  535.    end
  536.    
  537.    if @active_battler.current_action.basic == 0
  538.      if @active_battler.is_a?(Game_Actor)
  539.        if $data_weapons[@active_battler.weapon_id] == nil
  540.          @weapon_sprite = 4
  541.        else
  542.            @weapon_sprite = 4
  543.        end
  544.      else
  545.          @weapon_sprite_enemy = 4
  546.      end
  547.      @animation1_id = @active_battler.animation1_id
  548.      @animation2_id = @active_battler.animation2_id
  549.      if @active_battler.is_a?(Game_Enemy)
  550.        if @active_battler.restriction == 3
  551.          target = $game_troop.random_target_enemy
  552.        elsif @active_battler.restriction == 2
  553.          target = $game_party.random_target_actor
  554.        else
  555.          index = @active_battler.current_action.target_index
  556.          target = $game_party.smooth_target_actor(index)
  557.        end
  558.          x = target.screen_x - RPG::Cache.battler(@active_battler.battler_name, @active_battler.battler_hue).width/6
  559.          @spriteset.enemy_sprites[@active_battler.index].enemy_pose(0)
  560.          @spriteset.enemy_sprites[@active_battler.index].move(x, target.screen_y, 10)
  561.      end
  562.      if @active_battler.is_a?(Game_Actor)
  563.        if @active_battler.restriction == 3
  564.          target = $game_party.random_target_actor
  565.        elsif @active_battler.restriction == 2
  566.          target = $game_troop.random_target_enemy
  567.        else
  568.          index = @active_battler.current_action.target_index
  569.          target = $game_troop.smooth_target_enemy(index)
  570.        end
  571.        x = target.screen_x + RPG::Cache.battler(@active_battler.battler_name, @active_battler.battler_hue).width/8
  572.        @spriteset.actor_sprites[@active_battler.index].pose(0)
  573.        @spriteset.actor_sprites[@active_battler.index].move(x, target.screen_y, 10)
  574.      end
  575.      @target_battlers = [target]
  576.      for target in @target_battlers
  577.        target.attack_effect(@active_battler)
  578.      end
  579.      return
  580.    end
  581.    if @active_battler.current_action.basic == 1
  582.      if @active_battler.is_a?(Game_Actor)
  583.        @spriteset.actor_sprites[@active_battler.index].pose(2) #defence
  584.      else
  585.        @spriteset.enemy_sprites[@active_battler.index].enemy_pose(2) #defence
  586.      end
  587.      @help_window.set_text($data_system.words.guard, 1)
  588.      return
  589.    end
  590.    if @active_battler.is_a?(Game_Enemy) and
  591.       @active_battler.current_action.basic == 2
  592.      @help_window.set_text("逃走", 1)
  593.      @active_battler.escape
  594.      return
  595.    end
  596.    if @active_battler.current_action.basic == 3
  597.      $game_temp.forcing_battler = nil
  598.      @phase4_step = 1
  599.      return
  600.    end
  601.    if @active_battler.current_action.basic == 4
  602.      if $game_temp.battle_can_escape == false
  603.        $game_system.se_play($data_system.buzzer_se)
  604.        return
  605.      end
  606.      $game_system.se_play($data_system.decision_se)
  607.      update_phase2_escape
  608.      return
  609.    end
  610. end
  611. #--------------------------------------------------------------------------
  612. # skill aktion...
  613. #--------------------------------------------------------------------------
  614. def make_skill_action_result
  615.    @skill = $data_skills[@active_battler.current_action.skill_id]
  616.    unless @active_battler.current_action.forcing
  617.      unless @active_battler.skill_can_use?(@skill.id)
  618.        $game_temp.forcing_battler = nil
  619.        @phase4_step = 1
  620.        return
  621.      end
  622.    end
  623.    @active_battler.sp -= @skill.sp_cost
  624.    @status_window.refresh
  625.    @help_window.set_text(@skill.name, 1)
  626.    if @active_battler.is_a?(Game_Actor)
  627.      if @skill.name != "one of the skills" # <--skill doesn't exist => all the skills have the skill animation!
  628.        @spriteset.actor_sprites[@active_battler.index].pose(5) # <-- sprite number
  629.      end
  630.    else
  631.      if @skill.name != "one of the skills" # <-- first skill name
  632.        @spriteset.enemy_sprites[@active_battler.index].enemy_pose(5) # <-- sprite number
  633.      end
  634.    end
  635. #=============================================================================
  636. # SKILL SPRITES END
  637. #=============================================================================
  638.    @animation1_id = @skill.animation1_id
  639.    @animation2_id = @skill.animation2_id
  640.    @common_event_id = @skill.common_event_id
  641.    set_target_battlers(@skill.scope)
  642.    for target in @target_battlers
  643.      target.skill_effect(@active_battler, @skill)
  644.    end
  645. end
  646. #--------------------------------------------------------------------------
  647. # how here we make the item use aktions
  648. #--------------------------------------------------------------------------
  649. def make_item_action_result
  650.    if @active_battler.is_a?(Game_Actor)
  651.      @spriteset.actor_sprites[@active_battler.index].pose(1)
  652.    else
  653.      @spriteset.enemy_sprites[@active_battler.index].enemy_pose(1)
  654.    end
  655.    
  656.    @item = $data_items[@active_battler.current_action.item_id]
  657.    unless $game_party.item_can_use?(@item.id)
  658.      @phase4_step = 1
  659.      return
  660.    end
  661.    if @item.consumable
  662.      $game_party.lose_item(@item.id, 1)
  663.    end
  664.    @help_window.set_text(@item.name, 1)
  665.    @animation1_id = @item.animation1_id
  666.    @animation2_id = @item.animation2_id
  667.    @common_event_id = @item.common_event_id
  668.    index = @active_battler.current_action.target_index
  669.    target = $game_party.smooth_target_actor(index)
  670.    set_target_battlers(@item.scope)
  671.    for target in @target_battlers
  672.      target.item_effect(@item)
  673.    end
  674. end
  675.   
  676. #------------------战斗结束结果窗口------------------------------------
  677. def start_phase5
  678.    @phase = 5
  679.    $game_system.me_play($game_system.battle_end_me)
  680.    $game_system.bgm_play($game_temp.map_bgm)
  681.    exp = 0
  682.    gold = 0
  683.    treasures = []
  684.    for enemy in $game_troop.enemies
  685.      unless enemy.hidden
  686.        exp += enemy.exp
  687.        gold += enemy.gold
  688.        if rand(100) < enemy.treasure_prob
  689.          if enemy.item_id > 0
  690.            treasures.push($data_items[enemy.item_id])
  691.          end
  692.          if enemy.weapon_id > 0
  693.            treasures.push($data_weapons[enemy.weapon_id])
  694.          end
  695.          if enemy.armor_id > 0
  696.            treasures.push($data_armors[enemy.armor_id])
  697.          end
  698.        end
  699.      end
  700.    end
  701.    treasures = treasures[0..5]
  702.    for i in 0...$game_party.actors.size
  703.      actor = $game_party.actors[i]
  704.      @spriteset.actor_sprites[i].pose(7) unless actor.dead? # {=====}
  705.      if actor.cant_get_exp? == false
  706.        last_level = actor.level
  707.        actor.exp += exp
  708.        if actor.level > last_level
  709.          @status_window.level_up(i)
  710.        end
  711.      end
  712.    end
  713.    $game_party.gain_gold(gold)
  714.    for item in treasures
  715.      case item
  716.      when RPG::Item
  717.        $game_party.gain_item(item.id, 1)
  718.      when RPG::Weapon
  719.        $game_party.gain_weapon(item.id, 1)
  720.      when RPG::Armor
  721.        $game_party.gain_armor(item.id, 1)
  722.      end
  723.    end
  724.    @result_window = Window_BattleResult.new(exp, gold, treasures)
  725.    @phase5_wait_count = 10   #该数影响返回地图的等待时间
  726. end

  727. def update_phase4_step3
  728.    if @active_battler.current_action.kind == 0 and
  729.       @active_battler.current_action.basic == 0
  730.       # in this one... we have our weapon animations... for player and monster
  731.      if @active_battler.is_a?(Game_Actor)
  732.        @spriteset.actor_sprites[@active_battler.index].pose(@weapon_sprite)
  733.      elsif @active_battler.is_a?(Game_Enemy)
  734.        @spriteset.enemy_sprites[@active_battler.index].enemy_pose(@weapon_sprite_enemy)
  735.      end
  736.    end
  737.    if @animation1_id == 0
  738.      @active_battler.white_flash = true
  739.    else
  740.      @active_battler.animation_id = @animation1_id
  741.      @active_battler.animation_hit = true
  742.    end
  743.    @phase4_step = 4
  744. end

  745. def update_phase4_step4
  746.    # this here is for the hit animation...
  747.    for target in @target_battlers
  748.      if target.is_a?(Game_Actor) and !@active_battler.is_a?(Game_Actor)
  749.        if target.guarding?
  750.          @spriteset.actor_sprites[target.index].pose(2)
  751.        else
  752.          @spriteset.actor_sprites[target.index].pose(3)
  753.        end
  754.        elsif target.is_a?(Game_Enemy) and !@active_battler.is_a?(Game_Enemy)
  755.        if target.guarding?
  756.          @spriteset.enemy_sprites[target.index].enemy_pose(2)
  757.        else
  758.          @spriteset.enemy_sprites[target.index].enemy_pose(3)
  759.        end
  760.      end
  761.      target.animation_id = @animation2_id
  762.      target.animation_hit = (target.damage != "Miss")
  763.    end
  764.    @wait_count = 8
  765.    @phase4_step = 5
  766. end

  767. def update_phase4_step5
  768.   if @active_battler.hp > 0 and @active_battler.slip_damage?
  769.      @active_battler.slip_damage_effect
  770.      @active_battler.damage_pop = true
  771.    end

  772.    @help_window.visible = false
  773.    @status_window.refresh
  774.    # here comes the guard animations....
  775.    if @active_battler.is_a?(Game_Actor)
  776.      @spriteset.actor_sprites[@active_battler.index].pose(1)
  777.    else
  778.      @spriteset.enemy_sprites[@active_battler.index].enemy_pose(1)
  779.    end
  780.    for target in @target_battlers
  781.      if target.damage != nil
  782.        target.damage_pop = true
  783.        if @active_battler.is_a?(Game_Actor)
  784.          @spriteset.actor_sprites[@active_battler.index].pose(1)
  785.        else
  786.          @spriteset.enemy_sprites[@active_battler.index].enemy_pose(1)
  787.        end
  788.      end
  789.    end
  790.    @phase4_step = 6
  791. end

  792. #--------------------------------------------------------------------------
  793. # ● フレーム更新 (メインフェーズ ステップ 6 : リフレッシュ)
  794. #--------------------------------------------------------------------------
  795. def update_phase4_step6

  796.    if @active_battler.is_a?(Game_Actor) and !@active_battler.dead?
  797.      @spriteset.actor_sprites[@active_battler.index].move(@active_battler.screen_x, @active_battler.screen_y, 20)
  798.      @spriteset.actor_sprites[@active_battler.index].pose(1)
  799.    elsif !@active_battler.dead?
  800.      @spriteset.enemy_sprites[@active_battler.index].move(@active_battler.screen_x, @active_battler.screen_y, 20)
  801.      @spriteset.enemy_sprites[@active_battler.index].enemy_pose(1)
  802.    end
  803.    for target in @target_battlers
  804.      if target.is_a?(Game_Actor) and !target.dead?
  805.          @spriteset.actor_sprites[target.index].pose(1)
  806.        elsif !target.dead?
  807.          @spriteset.enemy_sprites[target.index].enemy_pose(1)
  808.      end
  809.    end
  810.    $game_temp.forcing_battler = nil
  811.    if @common_event_id > 0
  812.      common_event = $data_common_events[@common_event_id]
  813.      $game_system.battle_interpreter.setup(common_event.list, 0)
  814.    end
  815.    @phase4_step = 7
  816. end

  817. def update_phase4_step7
  818.    if @active_battler.is_a?(Game_Actor) and !@active_battler.dead?
  819.      @spriteset.actor_sprites[@active_battler.index].pose(1)
  820.    elsif !@active_battler.dead?
  821.      @spriteset.enemy_sprites[@active_battler.index].enemy_pose(1)
  822.    end
  823.    $game_temp.forcing_battler = nil
  824.    if @common_event_id > 0
  825.     common_event = $data_common_events[@common_event_id]
  826.      $game_system.battle_interpreter.setup(common_event.list, 0)
  827.    end
  828.    @phase4_step = 1
  829. end

  830. def update
  831.    if $game_system.battle_interpreter.running?
  832.      $game_system.battle_interpreter.update
  833.      if $game_temp.forcing_battler == nil
  834.        unless $game_system.battle_interpreter.running?
  835.          unless judge
  836.            setup_battle_event
  837.          end
  838.        end
  839.        if @phase != 5
  840.          @status_window.refresh
  841.        end
  842.      end
  843.    end
  844.    $game_system.update
  845.    $game_screen.update
  846.    if $game_system.timer_working and $game_system.timer == 0
  847.      $game_temp.battle_abort = true
  848.    end
  849.    @help_window.update
  850.    @party_command_window.update
  851.    @actor_command_window.update
  852.    @status_window.update
  853.    @message_window.update
  854.    @spriteset.update
  855.    if $game_temp.transition_processing
  856.      $game_temp.transition_processing = false
  857.      if $game_temp.transition_name == ""
  858.        Graphics.transition(20)
  859.      else
  860.        Graphics.transition(40, "Graphics/Transitions/" +
  861.          $game_temp.transition_name)
  862.      end
  863.    end
  864.    if $game_temp.message_window_showing
  865.      return
  866.    end
  867.    if @spriteset.effect?
  868.      return
  869.    end
  870.    if $game_temp.gameover
  871.      $scene = Scene_Gameover.new
  872.      return
  873.    end
  874.    if $game_temp.to_title
  875.      $scene = Scene_Title.new
  876.      return
  877.    end
  878.    if $game_temp.battle_abort
  879.      $game_system.bgm_play($game_temp.map_bgm)
  880.      battle_end(1)
  881.      return
  882.    end
  883.    if @wait_count > 0
  884.      @wait_count -= 1
  885.      return
  886.    end
  887.    for actor in @spriteset.actor_sprites
  888.      if actor.moving
  889.        return
  890.      end
  891.    end
  892.    for enemy in @spriteset.enemy_sprites
  893.      if enemy.moving# and $game_system.animated_enemy
  894.        return
  895.      end
  896.    end
  897.    if $game_temp.forcing_battler == nil and
  898.       $game_system.battle_interpreter.running?
  899.      return
  900.    end
  901.    case @phase
  902.    when 1
  903.      update_phase1
  904.    when 2
  905.      update_phase2
  906.    when 3
  907.      update_phase3
  908.    when 4
  909.      update_phase4
  910.    when 5
  911.      update_phase5
  912.    end
  913. end
  914. end
复制代码




david_ng223 该用户已被删除
发表于 2014-2-15 12:24:25 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
回复

使用道具 举报

梦石
0
星屑
50
在线时间
36 小时
注册时间
2013-11-17
回帖
41
 楼主| 发表于 2014-2-15 15:39:05 | 显示全部楼层
3q,以后我会注意
回复

使用道具 举报

david_ng223 该用户已被删除
发表于 2014-3-7 12:39:51 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部