Project1

标题: 超级横版战斗脚本 [打印本页]

作者: sblkhgm    时间: 2013-8-25 09:36
标题: 超级横版战斗脚本

超级横版战斗脚本 怎么改成 全动画战斗类的  求高手指点
  1. module RPG
  2.   class Class
  3.     def name
  4.       name = @name.split(/,/)[0]
  5.       return name != nil ? name : ''
  6.     end
  7.     def name2
  8.       name = @name.split(/,/)[1]
  9.       return name != nil ? name : ''
  10.    end
  11.   end
  12.   class Weapon
  13.     def name
  14.       name = @name.split(/,/)[0]
  15.       return name != nil ? name : ''
  16.     end
  17.     def name2
  18.       name = @name.split(/,/)[1]
  19.       return name != nil ? name : ''
  20.     end   
  21.   end  
  22. end

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

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

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

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

  71. #--------------------------------------------------------------------------
  72. # Comment by RPG
  73. #   - Change the source rect (change the animation)
  74. #   frames : Number of animation frames
  75. #   delay : Frame delay, controls animation speed
  76. #   offx : X coordinate of the 1st frame
  77. #   offy : Y coordinate of all frames
  78. #   startf : Starting frame for animation
  79. #   once : Is the animation only played once?
  80. #   rm2k_mode : Animation pattern: 1-2-3-2 if true, 1-2-3-1 if false
  81. #
  82. # Comment by cybersam
  83. #
  84. # the rm2k_mode isnt pressent anymore...
  85. # if you want that feature then use rm2k or use RPG's scrîpt...
  86. #--------------------------------------------------------------------------
  87. def change(frames = 0, delay = 0, offx = 0, offy = 0,
  88.             startf = 0, once = false)
  89.    @frames = frames
  90.    @delay = delay
  91.    @offset_x, @offset_y = offx, offy
  92.    @current_frame = startf
  93.    @once = once
  94.    x = @current_frame * @frame_width + @offset_x
  95.    self.src_rect = Rect.new(x, @offset_y, @frame_width, @frame_height)
  96.    @goingup = true
  97.    @animated = true
  98. end
  99.   
  100. #--------------------------------------------------------------------------
  101. # - Update animation and movement
  102. #--------------------------------------------------------------------------
  103. def update
  104.    super
  105.    if self.bitmap != nil and delay(@delay) and @animated
  106.      x = @current_frame * @frame_width + @offset_x
  107.      self.src_rect = Rect.new(x, @offset_y, @frame_width, @frame_height)
  108.        @current_frame = (@current_frame + 1) unless @frames == 0
  109.        @animated = false if @current_frame == @frames and @once
  110.        @current_frame %= @frames
  111.    end
  112. end
  113.   
  114. #--------------------------------------------------------------------------
  115. # - Move the sprite
  116. #   x : X coordinate of the destination point
  117. #   y : Y coordinate of the destination point
  118. #   speed : Speed of movement (0 = delayed, 1+ = faster)
  119. #   delay : Movement delay if speed is at 0
  120. #--------------------------------------------------------------------------
  121. def move(x, y, speed = 1, delay = 0)
  122.    @destx = x
  123.    @desty = y
  124.    @move_speed = speed
  125.    @move_delay = delay
  126.    @move_old = Graphics.frame_count
  127.    @moving = true
  128. end
  129.   
  130. #--------------------------------------------------------------------------
  131. # - Move sprite to destx and desty
  132. #--------------------------------------------------------------------------
  133. def update_move
  134.    return unless @moving
  135.    movinc = @move_speed == 0 ? 1 : @move_speed
  136.    if Graphics.frame_count - @move_old > @move_delay or @move_speed != 0
  137.      self.x += movinc if self.x < @destx
  138.      self.x -= movinc if self.x > @destx
  139.      self.y += movinc if self.y < @desty
  140.      self.y -= movinc if self.y > @desty
  141.      @move_old = Graphics.frame_count
  142.    end
  143.    if @move_speed > 1  # Check if sprite can't reach that point
  144.      self.x = @destx if (@destx - self.x).abs % @move_speed != 0 and
  145.                         (@destx - self.x).abs <= @move_speed
  146.      self.y = @desty if (@desty - self.y).abs % @move_speed != 0 and
  147.                         (@desty - self.y).abs <= @move_speed
  148.    end
  149.    if self.x == @destx and self.y == @desty
  150.      @moving = false
  151.    end
  152. end
  153.   
  154. #--------------------------------------------------------------------------
  155. # - Pause animation, but still updates movement
  156. #   frames : Number of frames
  157. #--------------------------------------------------------------------------
  158. def delay(frames)
  159.    update_move
  160.    if (Graphics.frame_count - @old >= frames)
  161.      @old = Graphics.frame_count
  162.      return true
  163.    end
  164.    return false
  165. end
  166. end

  167. #=============================================================================
  168. #
  169. # here we go...
  170. # this makes the scrîpt very easy to implement
  171. # just add a new scrîpt above the "Main" scrîpt
  172. # and insert this whole thing in there
  173. #
  174. # as you can see the sprite changing code is from the japanese scrîpt
  175. # so the credits for the sprite changin goes to them....
  176. # i edit it a little so it can show more sprites and sprite animations
  177. # and added some other stuff... the next things are player movement...
  178. #
  179. #
  180. #
  181. # i got the battler changing scrîpt in this scrîpt...
  182. # the credits for this goes to the guy who made this...
  183. #
  184. # ▼▲▼ XRXS11. 戦闘・バトラーモーション ver.0 ▼▲▼
  185. #
  186. # since this isnt used anymore... it isnt need for credit anymore...
  187. # but i'll let it here since it helped me a lot...
  188. #
  189. #
  190. # as for the ideas... missy provided me with really good ideas
  191. # that helped me alot when i didnt find a way to some of these features...
  192. #
  193. # here one more Credit to place...
  194. # its RPG's scrîpt...
  195. # not the whole thing here...
  196. # but some snipplet you'll know witch one when read the comments
  197. #
  198. #
  199. # if you want some more explaines about this scrîpt...
  200. # the most stuff are commented... but if you still have questions or
  201. # sugestions then you can contact me
  202. #
  203. # how or where you can contact me...
  204. # at the http://www.rmxp.net forum via pm, email: [email protected]
  205. # or via AIM: cych4n or ICQ: 73130840
  206. #
  207. # remember this is still in testing phase...
  208. # and i'm trying to work on some other additions... like character movements...
  209. # but that wont be added now... couse i need to figure it out first...
  210. #
  211. #
  212. #
  213. # oh hehe.... before i forget...
  214. # sorry for the bad english... ^-^''''
  215. #
  216. #
  217. #==============================================================================
  218. #
  219. # here i'm going to tell you what names you need to give for your chara
  220. # battle sprites....
  221. #
  222. # ok... here... since i'm using RPG's movement scrîpt...
  223. # there are a lot of changes...
  224. #
  225. # when you look at the scrîpt you'll find line with "pose(n)" or "enemy_pose(n)"
  226. # since i want my sprites have different sprites... i added one more option
  227. # to these...
  228. # so now if you add a number after the n (the n stands for witch sprite is used)
  229. # fo example 8... ("pose(4, 8)") this will tell the scrîpt that the 4th animation
  230. # have 8 frames...
  231. # pose is used for the player... and enemy_pose for the enemy...
  232. # there is nothing more to this...
  233. # i used my old sprite numbers... (this time in only one sprite...)
  234. #
  235. # explains about the animation sprites... (the digits)
  236. #
  237. #
  238. # 0 = move (during battle)
  239. # 1 = standby
  240. # 2 = defend
  241. # 3 = hit (being attacked)
  242. # 4 = attack
  243. # 5 = skill use
  244. # 6 = dead
  245. # 7 = winning pose... this idea is from RPG....
  246. #
  247. #
  248. # of course this is just the begining of the code...
  249. # so more animations can be implemented...
  250. # but for now this should be enough...
  251. #
  252. # alot has changed here... and now it looks like it is done...
  253. # of course the fine edit needs to be done so it looks and works great with your
  254. # game too...
  255. #
  256. #
  257. #
  258. # 1st character movement...                             done
  259. # 2nd character movement during attack...               done
  260. # 3rd character apears at the enemy while attacking...  done
  261. #
  262. # 4th enemies movement...                               done
  263. # 5th enemy movement during attack...                   done
  264. # 6th enemy apears at the enemy while attacking...      done
  265. #
  266. # 7th each weapon has its own animation...              done
  267. # 8th each skill has its own animation...               done
  268. #
  269. #
  270. #
  271. # for the ones interisted... my nex project is an Movie player
  272. # (that actualy plays avi, mpgs and such...
  273. # but dont think this will be done soon... ^-^''
  274. #
  275. # but i'll may be try something else before i begin to code that one...
  276. #==============================================================================



  277. class Game_Actor < Game_Battler
  278.   
  279. # you dont have to change your game actor to let the characters schows
  280. # from the side...
  281. # this will do it for you... ^-^

  282. def screen_x
  283.     # 返回计算后的队伍 X 坐标的排列顺序
  284. #   if self.index != nil
  285. #     return self.index * 60 + 360
  286. #   else
  287. #     return 0
  288. #   end
  289. # end
  290.     case self.index
  291.     when 0
  292.       return 400
  293.     when 1
  294.       return 480
  295.     when 2
  296.       return 540
  297.     when 3
  298.       return 570
  299.     else
  300.       return 1000
  301.     end
  302.   end   

  303. def screen_y
  304.    case self.index
  305.     when 0
  306.       return 385
  307.     when 1
  308.       return 365
  309.     when 2
  310.       return 330
  311.     when 3
  312.       return 265
  313.     else
  314.       return 1000
  315.     end
  316.   end

  317. def screen_z
  318.     # 返回计算后的队伍 Z 坐标的排列顺序
  319.     if self.index != nil
  320.       return 104 - self.index
  321.     else
  322.       return 0
  323.     end
  324.   end
  325. end

  326. # RPG's snipplet...
  327. class Spriteset_Battle
  328. attr_accessor :actor_sprites
  329. attr_accessor :enemy_sprites
  330.   
  331.   
  332. alias original_initialize initialize
  333. def initialize
  334.    #@start_party_number = $game_party.actors.size
  335.    # ビューポートを作成
  336.    @viewport0 = Viewport.new(0, 0, 640, 480)
  337.    @viewport1 = Viewport.new(0, 0, 640, 480)
  338.    @viewport2 = Viewport.new(0, 0, 640, 480)
  339.    @viewport3 = Viewport.new(0, 0, 640, 480)
  340.    @viewport4 = Viewport.new(0, 0, 640, 480)
  341.    @viewport1.z = 50
  342.    @viewport2.z = 50
  343.    @viewport3.z = 200
  344.    @viewport4.z = 5000

  345.    @battleback_sprite = Sprite.new(@viewport0)
  346.    
  347.    @enemy_sprites = []
  348.    for enemy in $game_troop.enemies #.reverse
  349.      @enemy_sprites.push(Sprite_Battler.new(@viewport1, enemy))
  350.    end
  351.    
  352.    @actor_sprites = []
  353.    @actor_sprites.push(Sprite_Battler.new(@viewport2,$game_party.actors[0]))
  354.    @actor_sprites.push(Sprite_Battler.new(@viewport2,$game_party.actors[1]))
  355.    @actor_sprites.push(Sprite_Battler.new(@viewport2,$game_party.actors[2]))
  356.    @actor_sprites.push(Sprite_Battler.new(@viewport2,$game_party.actors[3]))
  357.    
  358.    @weather = RPG::Weather.new(@viewport1)
  359.    @picture_sprites = []
  360.    for i in 51..100
  361.      @picture_sprites.push(Sprite_Picture.new(@viewport3,
  362.        $game_screen.pictures[i]))
  363.    end
  364.    @timer_sprite = Sprite_Timer.new
  365.    update
  366. end
  367.   
  368.   
  369.   
  370. alias original_update update
  371. def update
  372.    @viewport1.z = 50 and @viewport2.z = 51 #if $actor_on_top == true
  373. #  @viewport1.z = 51 and @viewport2.z = 50 if $actor_on_top == false
  374.     # 刷新角色的活动块 (对应角色的替换)
  375.     @actor_sprites[0].battler = $game_party.actors[0]
  376.     @actor_sprites[1].battler = $game_party.actors[1]
  377.     @actor_sprites[2].battler = $game_party.actors[2]
  378.     @actor_sprites[3].battler = $game_party.actors[3]
  379.     # 战斗背景的文件名与现在情况有差异的情况下
  380.     if @battleback_name != $game_temp.battleback_name
  381.       @battleback_name = $game_temp.battleback_name
  382.       if @battleback_sprite.bitmap != nil
  383.         @battleback_sprite.bitmap.dispose
  384.       end
  385.       @battleback_sprite.bitmap = RPG::Cache.battleback(@battleback_name)
  386.       @battleback_sprite.src_rect.set(0, 0, 640, 480)
  387.     end
  388.     # 刷新战斗者的活动块
  389.     for sprite in @enemy_sprites + @actor_sprites
  390.       sprite.update
  391.     end
  392.     # 刷新天气图形
  393.     @weather.type = $game_screen.weather_type
  394.     @weather.max = $game_screen.weather_max
  395.     @weather.update
  396.     # 刷新图片活动块
  397.     for sprite in @picture_sprites
  398.       sprite.update
  399.     end
  400.     # 刷新计时器活动块
  401.     @timer_sprite.update
  402.     # 设置画面的色调与震动位置
  403.     @viewport1.tone = $game_screen.tone
  404.     @viewport1.ox = $game_screen.shake
  405.     # 设置画面的闪烁色
  406.     @viewport4.color = $game_screen.flash_color
  407.     # 刷新显示端口
  408.     @viewport1.update
  409.     @viewport2.update
  410.     @viewport4.update
  411. end
  412. end
  413. # end

  414. #==============================================================================
  415. # Sprite Battler for the Costum Battle System
  416. #==============================================================================
  417. # here we are making some animations and stuff...
  418. # i know its not the best way...
  419. # but this is the first working way that i found....
  420. # this needs propper understanding how the animation works...
  421. # if you want to change some stuff...
  422. # in this i'll not explain much couse its realy easy if you know what you do
  423. # otherwise it will take you time to understand it, but i think the one who
  424. # is trying to edit this will know what he/she do... ^-^
  425. #
  426. #
  427. #
  428. # here i'll completely replace the "Sprite_Battler" class...
  429. # so if you've changed something in there you need to change it here as well
  430. # (i think... i didnt tested it... so its up to you)
  431. # i'll mark the stuff i added just with --> #
  432. # something that need to be explained have a comment...
  433. # but its not all commented...
  434. # so if you dont know what it means or you just want to know why it is there and
  435. # what it does then you need to contact me or anyone who understand this... ^-^
  436. # how you can contact me see above... at the top of this scrîpt...


  437. class Sprite_Battler < Animated_Sprite

  438. attr_accessor :battler
  439. attr_reader   :index
  440. attr_accessor :target_index
  441. attr_accessor :frame_width

  442.   
  443. def initialize(viewport, battler = nil)
  444.    super(viewport)
  445.    [url=home.php?mod=space&uid=133701]@battler[/url] = battler
  446.    @pattern_b = 0 #
  447.    @counter_b = 0 #
  448.    [url=home.php?mod=space&uid=370741]@Index[/url] = 0     #
  449.    
  450.    
  451.     @sprite_contens = Sprite.new#(viewport)
  452.     @sprite_contens.x = 0
  453.     @sprite_contens.y = 0
  454.     @sprite_contens.bitmap = Bitmap.new(160,48)
  455.    @name = ""
  456.    
  457.    if @battler != nil
  458.      tempbitmap = RPG::Cache.battler(@battler.battler_name, @battler.battler_hue)
  459.      @frame_width = tempbitmap.width/4
  460.      picturephase = @battler.picturephase
  461.     # if picturephase == "66RPG"
  462.        @frame_height = tempbitmap.height/8
  463.      #else
  464.       # @frame_height = 64
  465.      #end     
  466.    else
  467.      @frame_width, @frame_height = 1,1
  468.    end   
  469.    # start sprite
  470.    @battler.is_a?(Game_Enemy) ? enemy_pose(1) : pose(1)
  471.    @battler_visible = false
  472.    if $target_index == nil
  473.      $target_index = 0
  474.    end
  475. end
  476.   
  477. def index=(index) #
  478.    @index = index  #
  479.    update          #
  480. end               #
  481.   
  482. def dispose
  483.    if self.bitmap != nil
  484.      self.bitmap.dispose
  485.    end
  486.    super
  487. end
  488.   
  489. def enemy                                             #
  490.    $target_index += $game_troop.enemies.size
  491.    $target_index %= $game_troop.enemies.size
  492.    return $game_troop.enemies[$target_index]           #
  493. end                                                   #
  494.   
  495. def actor                                             #
  496.    $target_index += $game_party.actors.size
  497.    $target_index %= $game_party.actors.size
  498.    return $game_party.actors[$target_index]            #
  499. end            

  500.   #--------------------------------------------------------------------------
  501.   # ● 战斗中名字的描绘
  502.   #--------------------------------------------------------------------------
  503.   def draw_actor_name(actor, x, y)
  504.     @sprite_contens.bitmap.font.color = Color.new(0, 230, 50, 255)
  505.     @sprite_contens.bitmap.font.size = 16
  506.     @sprite_contens.bitmap.draw_text(x, y, 100, 32, "jjijijiaf",1)
  507.   end   



  508. #==============================================================================
  509. # here is a snipplet from RPG's scrîpt...
  510. # i changed only to lines from this...
  511. #
  512. # here you can add more sprite poses... if you have more... ^-^
  513. #==============================================================================
  514. def pose(number, frames = 4)
  515.     case number
  516.     when 0  # run
  517.     change(frames, 5, 0, 0, 0)
  518.     when 1  # standby
  519.     change(frames, 5, 0, @frame_height)
  520.     when 2 # defend
  521.     change(frames, 5, 0, @frame_height * 2)
  522.     when 3 # Hurt, loops
  523.     change(frames, 5, 0, @frame_height * 3)
  524.     when 4 # attack no loop
  525.     change(frames, 5, 0, @frame_height * 4, 0, true)
  526.     when 5 # skill
  527.     change(frames, 5, 0, @frame_height * 5)
  528.     when 6 # death
  529.     change(frames, 5, 0, @frame_height * 6)
  530.     when 7 # winning pose
  531.     change(frames, 5, 0, @frame_height * 7)
  532.     when 8 # no sprite
  533.     change(frames, 5, 0, @frame_height * 8)
  534.     when 9 # no sprite
  535.     change(frames, 5, 0, @frame_height * 9)
  536.     when 10 # no sprite
  537.     change(frames, 5, 0, @frame_height * 10)
  538.     when 11 # no sprite
  539.     change(frames, 5, 0, @frame_height * 11)
  540.     when 12 # no sprite
  541.     change(frames, 5, 0, @frame_height * 12)
  542.     when 13 # no sprite
  543.     change(frames, 5, 0, @frame_height * 13)
  544.     when 14 # no sprite
  545.     change(frames, 5, 0, @frame_height * 14)
  546.     when 15 # no sprite
  547.     change(frames, 5, 0, @frame_height * 15)
  548.     when 16 # no sprite
  549.     change(frames, 5, 0, @frame_height * 16)
  550.     when 17 # no sprite
  551.     change(frames, 5, 0, @frame_height * 17)
  552.     when 18 # no sprite
  553.     change(frames, 5, 0, @frame_height * 18)
  554.     when 19 # no sprite
  555.     change(frames, 5, 0, @frame_height * 19)
  556.     when 20 # no sprite
  557.     change(frames, 5, 0, @frame_height * 20)
  558.     # ...etc.
  559.    else
  560.      change(frames, 5, 0, @frame_height * number, 0)
  561.    end
  562. end
  563.   
  564. #--------------------------------------------------------------------------
  565. # - Change the battle pose for an enemy
  566. #   number : pose' number
  567. #--------------------------------------------------------------------------
  568. def enemy_pose(number ,enemy_frames = 4)
  569.    case number
  570.    when 0  # run
  571.      change(enemy_frames, 5, 0, 0, 0)
  572.    when 1  # standby
  573.      change(enemy_frames, 5, 0, @frame_height)
  574.    when 2 # defend
  575.      change(enemy_frames, 5, 0, @frame_height * 2)
  576.    when 3 # Hurt, loops
  577.      change(enemy_frames, 5, 0, @frame_height * 3)
  578.    when 4 # attack
  579.      change(enemy_frames, 5, 0, @frame_height * 4, 0, true)
  580.    when 5 # skill
  581.      change(enemy_frames, 5, 0, @frame_height * 5)
  582.    when 6 # death
  583.      change(enemy_frames, 5, 0, @frame_height * 6)
  584.    when 7 # no sprite
  585.      change(enemy_frames, 5, 0, @frame_height * 7)
  586.      # ...etc.
  587.    else
  588.      change(enemy_frames, 5, 0, @frame_height * number, 0)
  589.    end
  590. end
  591. #==============================================================================
  592. # sniplet end...
  593. #==============================================================================  
  594.   
  595.   def update
  596.    super
  597.    # draw_actor_name(@battler, 0, 0)

  598.    if @battler == nil   
  599.      @battler_name = ""
  600.      self.bitmap = nil                                                      
  601.      loop_animation(nil)                                                   
  602.      return                                                               
  603.    end  
  604.    
  605.    
  606.    
  607.    if @battler.battler_name != @battler_name or
  608.       @battler.battler_hue != @battler_hue

  609.      @battler_name = @battler.battler_name
  610.      @battler_hue = @battler.battler_hue
  611.      self.bitmap = RPG::Cache.battler(@battler_name, @battler_hue)
  612.      @width = bitmap.width
  613.      [url=home.php?mod=space&uid=291977]@height[/url] = bitmap.height
  614.      self.ox = @frame_width / 2
  615.      self.oy = @frame_height
  616.      
  617.      if @battler.dead? or @battler.hidden
  618.        self.opacity = 0
  619.      end   
  620.      self.x =  @battler.screen_x
  621.      self.y =  @battler.screen_y
  622.      self.z = @battler.screen_z
  623.    end

  624.    if @battler.damage == nil and
  625.       @battler.state_animation_id != @state_animation_id
  626.      @state_animation_id = @battler.state_animation_id
  627.      loop_animation($data_animations[@state_animation_id])
  628.    end

  629.    if @battler.is_a?(Game_Actor) and @battler_visible
  630.      if $game_temp.battle_main_phase
  631.        self.opacity += 3 if self.opacity < 255
  632.      else
  633.        self.opacity -= 3 if self.opacity > 207
  634.      end
  635.    end
  636.    
  637.      if battler.state?(51)
  638.        self.opacity = 100
  639.      end  


  640.    if @battler.blink
  641.      blink_on
  642.    else
  643.      blink_off
  644.    end

  645.    unless @battler_visible
  646.      if not @battler.hidden and not @battler.dead? and
  647.         (@battler.damage == nil or @battler.damage_pop)
  648.        appear
  649.        @battler_visible = true
  650.      end
  651.      if not @battler.hidden and
  652.         (@battler.damage == nil or @battler.damage_pop) and
  653.         @battler.is_a?(Game_Actor)
  654.        appear
  655.        @battler_visible = true
  656.      end
  657.    end
  658.    if @battler_visible
  659.      if @battler.hidden
  660.        $game_system.se_play($data_system.escape_se)
  661.        escape
  662.        @battler_visible = false
  663.      end
  664.      if @battler.white_flash
  665.        whiten
  666.        @battler.white_flash = false
  667.      end
  668.      if @battler.animation_id != 0
  669.        animation = $data_animations[@battler.animation_id]
  670.        animation(animation, @battler.animation_hit)
  671.        @battler.animation_id = 0
  672.      end
  673.      if @battler.damage_pop
  674.        damage(@battler.damage, @battler.critical)
  675.        @battler.damage = nil
  676.        @battler.critical = false
  677.        @battler.damage_pop = false
  678.      end
  679.      if @battler.damage == nil and @battler.dead?
  680.        if @battler.is_a?(Game_Enemy)
  681.          $game_system.se_play($data_system.enemy_collapse_se)
  682.          collapse
  683.          @battler_visible = false
  684.         else
  685.          case @battler.id        
  686.            when 1
  687.            Audio.se_play("Audio/SE/"+"1",90,100) unless @dead
  688.            when 2
  689.            Audio.se_play("Audio/SE/"+"2",90,100) unless @dead
  690.            when 3
  691.            Audio.se_play("Audio/SE/"+"3",90,100) unless @dead
  692.            when 4
  693.            Audio.se_play("Audio/SE/"+"4",90,100) unless @dead
  694.            when 5
  695.            Audio.se_play("Audio/SE/"+"5",90,100) unless @dead
  696.            when 6
  697.            Audio.se_play("Audio/SE/"+"6",90,100) unless @dead
  698.            when 7
  699.            Audio.se_play("Audio/SE/"+"7",90,100) unless @dead
  700.            when 8
  701.            Audio.se_play("Audio/SE/"+"8",90,100) unless @dead
  702.            when 9
  703.            Audio.se_play("Audio/SE/"+"9",90,100) unless @dead
  704.          end
  705.           @dead = true
  706.           pose(6)
  707.         end
  708.         # else
  709.         # $game_system.se_play($data_system.actor_collapse_se) unless @dead
  710.         # @dead = true
  711.         # pose(6)
  712.        # end
  713.      else
  714.        @dead = false
  715.      end
  716.    end                                                                #
  717. end
  718. end



  719. #==============================================================================
  720. # Scene_Battle Costum  Battle System
  721. #==============================================================================

  722. class Scene_Battle
  723.   
  724.   
  725. def update_phase4
  726.    case @phase4_step
  727.    when 1
  728.      update_phase4_step1
  729.    when 2
  730.      update_phase4_step2
  731.    when 3
  732.      update_phase4_step3
  733.    when 4
  734.      update_phase4_step4
  735.    when 5
  736.      update_phase4_step5
  737.    when 6
  738.      update_phase4_step6
  739.    when 7
  740.      update_phase4_step7
  741.    when 8
  742.     update_phase4_step8   
  743.    end
  744. end
  745.   
  746.   
  747. def make_basic_action_result
  748.    
  749.    if @active_battler.is_a?(Game_Actor)
  750.      $actor_on_top = true
  751.    elsif @active_battler.is_a?(Game_Enemy)
  752.      $actor_on_top = false
  753.    end
  754.    
  755.    if @active_battler.current_action.basic == 0
  756. #============================================================================
  757. # WEAPONS START...
  758. #============================================================================
  759. #
  760. #================================= Different Weapons with different animations
  761. #
  762. # this is quite simple as you can see...
  763. # if you want to add a weapon to the animation list then look at the scrîpt below...
  764. # and i hope you'll find out how this works...
  765. #
  766. #
  767. # if not...
  768. # here is the way...
  769. # first thing...
  770. # just copy and paste "elseif @active_battler_enemy.weapon_id == ID..."
  771. # just after the last @weapon_sprite....
  772. #
  773. # here the ID is you need to look in you game databse the number that stands before
  774. # your weapon name is the ID you need to input here...
  775. #
  776. # same thing goes for the monster party... ^-^
  777. # monster normaly dont need more sprites for weapons....
  778. #
  779. # if you want to use more... then replace the "@weapon_sprite_enemy = 4"
  780. # with these lines... (but you need to edit them)
  781. #
  782. #        if @active_battler.weapon_id == 1 # <--  weapon ID number
  783. #          @weapon_sprite_enemy = 4 # <-- battle animation
  784. #        elsif @active_battler.weapon_id == 5 # <-- weapon ID number
  785. #          @weapon_sprite_enemy = 2 # <-- battle animation
  786. #        elsif @active_battler.weapon_id == 9 # <-- weapon ID number
  787. #          @weapon_sprite_enemy = 0 # <-- battle animation
  788. #        elsif @active_battler.weapon_id == 13 # <-- weapon ID number
  789. #          @weapon_sprite_enemy = 6 # <-- battle animation
  790. #        else
  791. #          @weapon_sprite_enemy = 4
  792. #        end
  793. #
  794. #================================= END

  795.      if @active_battler.is_a?(Game_Actor)
  796.        if $data_weapons[@active_battler.weapon_id] == nil
  797.          @weapon_sprite = 4
  798.        else
  799.          #if $data_weapons[@active_battler.weapon_id].name2 == nil or
  800.           # $data_weapons[@active_battler.weapon_id].name2 == ""
  801.            @weapon_sprite = 4
  802.          #else
  803.           # @weapon_sprite = $data_weapons[@active_battler.weapon_id].name2.to_i
  804.          #end
  805.        end
  806.         
  807. # monster section is here... ^-^

  808.      else # @active_battler.is_a?(Game_Enemy)
  809.          @weapon_sprite_enemy = 4
  810.      end
  811.         
  812. #
  813. #=============================================================================
  814. # WEAPONS END....
  815. #=============================================================================
  816.       
  817.       
  818.      @animation1_id = @active_battler.animation1_id
  819.      @animation2_id = @active_battler.animation2_id      
  820.      if @active_battler.is_a?(Game_Enemy)
  821.        if @active_battler.restriction == 3
  822.          target = $game_troop.random_target_enemy
  823.        elsif @active_battler.restriction == 2
  824.          target = $game_party.random_target_actor
  825.        else
  826.          index = @active_battler.current_action.target_index
  827.          target = $game_party.smooth_target_actor(index)
  828.        end
  829. #======== here is the setting for the movement & animation...
  830.          x = target.screen_x - RPG::Cache.battler(@active_battler.battler_name, @active_battler.battler_hue).width/6
  831.          @spriteset.enemy_sprites[@active_battler.index].enemy_pose(0)
  832.          @spriteset.enemy_sprites[@active_battler.index].move(x, target.screen_y, 10)
  833. #========= here if you look at the RPG's movement settings you'll see
  834. #========= that he takes the number 40 for the speed of the animation...
  835. #========= i thing thats too fast so i settet it down to 10 so looks smoother...
  836.      end
  837.      if @active_battler.is_a?(Game_Actor)
  838.        if @active_battler.restriction == 3
  839.          target = $game_party.random_target_actor
  840.        elsif @active_battler.restriction == 2
  841.          target = $game_troop.random_target_enemy
  842.        else
  843.          index = @active_battler.current_action.target_index
  844.          target = $game_troop.smooth_target_enemy(index)
  845.        end
  846. #======= the same thing for the player... ^-^
  847.        x = target.screen_x + RPG::Cache.battler(@active_battler.battler_name, @active_battler.battler_hue).width/8
  848.        @spriteset.actor_sprites[@active_battler.index].pose(0)
  849.        @spriteset.actor_sprites[@active_battler.index].move(x, target.screen_y, 10)
  850.      end
  851.      @target_battlers = [target]
  852.      for target in @target_battlers
  853.        target.attack_effect(@active_battler)
  854.      end
  855.      return
  856.    end
  857.    if @active_battler.current_action.basic == 1
  858.      if @active_battler.is_a?(Game_Actor)
  859.        @spriteset.actor_sprites[@active_battler.index].pose(2) #defence
  860.      else
  861.        @spriteset.enemy_sprites[@active_battler.index].enemy_pose(2) #defence
  862.      end
  863. #     @help_window.set_text($data_system.words.guard, 1)
  864.      return
  865.    end
  866.    if @active_battler.is_a?(Game_Enemy) and
  867.       @active_battler.current_action.basic == 2
  868. #     @help_window.set_text("逃走", 1)
  869.      @active_battler.escape
  870.      return
  871.    end
  872.    if @active_battler.current_action.basic == 3
  873.      $game_temp.forcing_battler = nil
  874.      @phase4_step = 1
  875.      return
  876.    end
  877.    
  878.    if @active_battler.current_action.basic == 4
  879.      if $game_temp.battle_can_escape == false
  880.        $game_system.se_play($data_system.buzzer_se)
  881.        return
  882.      end
  883.      $game_system.se_play($data_system.decision_se)
  884.      update_phase2_escape
  885.      return
  886.    end
  887. end
  888. #--------------------------------------------------------------------------
  889. # skill aktion...
  890. #--------------------------------------------------------------------------
  891. def make_skill_action_result
  892.    @skill = $data_skills[@active_battler.current_action.skill_id]
  893.    unless @active_battler.current_action.forcing
  894.      unless @active_battler.skill_can_use?(@skill.id)
  895.        $game_temp.forcing_battler = nil
  896.        @phase4_step = 1
  897.        return
  898.      end
  899.    end
  900.    @active_battler.sp -= @skill.sp_cost
  901.    @status_window.refresh
  902.    @help_window.set_text(@skill.name, 1)
  903.    
  904. #=============================================================================
  905. # SKILL SPRITES START
  906. #=============================================================================
  907. # this one is the same as the one for the weapons...
  908. # for the one who have this for the first time
  909. # look at the scrîpt i hope it is easy to understand...
  910. #
  911. # the other one that have the earlier versions of this scrîpt they dont need explenation
  912. # ... i think....
  913. # the think that changed is the line where the animation ID is given to the sprite...
  914. # the number after the "pose" is the animation ID... it goes for every other animation as well..
  915. # if you have an animation for a skill that have more frames...
  916. # then just insert the number of frames after the first number...
  917. # so it looks like this.... "pose(5, 8)" <-- 5 is the animation...
  918. # 8 is the max frame (that means your animation have 8 frames...) ^-^
  919.    
  920.    if @active_battler.is_a?(Game_Actor)
  921.      if @skill.name != "one of the skills" # <--skill doesn't exist => all the skills have the skill animation!
  922.        @spriteset.actor_sprites[@active_battler.index].pose(5) # <-- sprite number
  923.      end
  924.   else
  925.      if @skill.name != "one of the skills" # <-- first skill name
  926.        @spriteset.enemy_sprites[@active_battler.index].enemy_pose(5) # <-- sprite number
  927.       end
  928.    end
  929. #=============================================================================
  930. # SKILL SPRITES END
  931. #=============================================================================
  932.    
  933.    @animation1_id = @skill.animation1_id
  934.    @animation2_id = @skill.animation2_id
  935.    @common_event_id = @skill.common_event_id
  936.    set_target_battlers(@skill.scope)
  937.    for target in @target_battlers
  938.      target.skill_effect(@active_battler, @skill)
  939.     end
  940. end
  941. #--------------------------------------------------------------------------
  942. # how here we make the item use aktions
  943. #--------------------------------------------------------------------------
  944. def make_item_action_result
  945.    # sorry i didnt work on this...
  946.    # couse i dont have a sprite that uses items....
  947.    # so i just added the standby sprite here...
  948.    # when i get more time for this i'll try what i can do for this one... ^-^
  949.    # its the same as the ones above...
  950.    if @active_battler.is_a?(Game_Actor)
  951.      @spriteset.actor_sprites[@active_battler.index].pose(5)
  952.    else
  953.      @spriteset.enemy_sprites[@active_battler.index].enemy_pose(5)
  954.    end
  955.    
  956.    @item = $data_items[@active_battler.current_action.item_id]
  957.    unless $game_party.item_can_use?(@item.id)
  958.      @phase4_step = 1
  959.      return
  960.    end
  961.    if @item.consumable
  962.      $game_party.lose_item(@item.id, 1)
  963.    end
  964.    @help_window.set_text(@item.name, 1)
  965.    @animation1_id = @item.animation1_id
  966.    @animation2_id = @item.animation2_id
  967.    @common_event_id = @item.common_event_id
  968.    index = @active_battler.current_action.target_index
  969.    target = $game_party.smooth_target_actor(index)
  970.    set_target_battlers(@item.scope)
  971.    for target in @target_battlers
  972.      target.item_effect(@item)
  973.    end
  974. end
  975.   
  976. #==============================================================================
  977. # here again.... snipplet from RPG's scrîpt
  978. #==============================================================================


  979. # this one here is for the winning pose...
  980. # if you happen to use my old costum level scrîpt then you need to add the
  981. # marked line to you "def start_phase5" in  "Scene_Battle 2" and delete this one...
  982. # the ->  =*****=
  983. # marks the end where you need to delete...
  984. # and -> {=====}
  985. # marks the line you need to copy and paste in the other one...
  986. # you need to add it at the same position...

  987. # def start_phase5
  988. #   @phase = 5
  989. #   $game_system.me_play($game_system.battle_end_me)
  990. #   $game_system.bgm_play($game_temp.map_bgm)
  991. #   exp = 0
  992. #   gold = 0
  993. #   treasures = []
  994. #   for enemy in $game_troop.enemies
  995. #     unless enemy.hidden
  996. #       exp += enemy.exp
  997. #       gold += enemy.gold
  998. #       if rand(100) < enemy.treasure_prob
  999. #         if enemy.item_id > 0
  1000. #           treasures.push($data_items[enemy.item_id])
  1001. #         end
  1002. #         if enemy.weapon_id > 0
  1003. #           treasures.push($data_weapons[enemy.weapon_id])
  1004. #         end
  1005. #         if enemy.armor_id > 0
  1006. #           treasures.push($data_armors[enemy.armor_id])
  1007. #         end
  1008. #       end
  1009. #     end
  1010. #   end
  1011. #   treasures = treasures[0..5]
  1012. #   for i in 0...$game_party.actors.size
  1013. #     actor = $game_party.actors[i]
  1014. #     @spriteset.actor_sprites[i].pose(7) unless actor.dead? # {=====}
  1015. #     if actor.cant_get_exp? == false
  1016. #       last_level = actor.level
  1017. #       actor.exp += exp
  1018. #       if actor.level > last_level
  1019. #         @status_window.level_up(i)
  1020. #       end
  1021. #     end
  1022. #   end
  1023. #   $game_party.gain_gold(gold)
  1024. #   for item in treasures
  1025. #     case item
  1026. #     when RPG::Item
  1027. #       $game_party.gain_item(item.id, 1)
  1028. #     when RPG::Weapon
  1029. #       $game_party.gain_weapon(item.id, 1)
  1030. #     when RPG::Armor
  1031. #       $game_party.gain_armor(item.id, 1)
  1032. #     end
  1033. #   end
  1034. #   @result_window = Window_BattleResult.new(exp, gold, treasures)
  1035. #   @phase5_wait_count = 60
  1036. # end
  1037. #   =*****=
  1038. #--------------------------------------------------------------------------
  1039. # updating the movement
  1040. # since RPG isnt used to comments... i'll comment it again...
  1041. #--------------------------------------------------------------------------
  1042. def update_phase4_step3
  1043.    if @active_battler.current_action.kind == 0 and
  1044.       @active_battler.current_action.basic == 0
  1045.       # in this one... we have our weapon animations... for player and monster
  1046.      if @active_battler.is_a?(Game_Actor)
  1047.        @spriteset.actor_sprites[@active_battler.index].pose(@weapon_sprite)
  1048.      elsif @active_battler.is_a?(Game_Enemy)
  1049.        @spriteset.enemy_sprites[@active_battler.index].enemy_pose(@weapon_sprite_enemy)
  1050.      end
  1051.    end
  1052.    if @animation1_id == 0
  1053.      @active_battler.white_flash = true
  1054.    else
  1055.      @active_battler.animation_id = @animation1_id
  1056.      @active_battler.animation_hit = true
  1057.    end
  1058.    @phase4_step = 4
  1059. end

  1060. def update_phase4_step4
  1061.    # this here is for the hit animation...
  1062.    for target in @target_battlers
  1063.      if target.is_a?(Game_Actor) and !@active_battler.is_a?(Game_Actor)
  1064.        if target.guarding?
  1065.          @spriteset.actor_sprites[target.index].pose(2)
  1066.        else
  1067.          @spriteset.actor_sprites[target.index].pose(3)
  1068.        end
  1069.        elsif target.is_a?(Game_Enemy) and !@active_battler.is_a?(Game_Enemy)
  1070.        if target.guarding?
  1071.          @spriteset.enemy_sprites[target.index].enemy_pose(2)
  1072.        else
  1073.          @spriteset.enemy_sprites[target.index].enemy_pose(3)
  1074.        end
  1075.      end
  1076.      target.animation_id = @animation2_id
  1077.      target.animation_hit = (target.damage != "Miss")
  1078.    end
  1079.    @wait_count = 8
  1080.    @phase4_step = 5
  1081. end

  1082. def update_phase4_step5
  1083. #   if @active_battler.hp > 0 and @active_battler.slip_damage?
  1084. #     @active_battler.slip_damage_effect
  1085. #     @active_battler.damage_pop = true
  1086. #   end

  1087.    @help_window.visible = false
  1088.    @status_window.refresh
  1089.    # here comes the guard animations....
  1090.    if @active_battler.is_a?(Game_Actor)
  1091.      @spriteset.actor_sprites[@active_battler.index].pose(1)
  1092.    else
  1093.      @spriteset.enemy_sprites[@active_battler.index].enemy_pose(1)
  1094.    end
  1095.    for target in @target_battlers
  1096.      if target.damage != nil
  1097.        target.damage_pop = true
  1098.        if @active_battler.is_a?(Game_Actor)
  1099.          @spriteset.actor_sprites[@active_battler.index].pose(1)
  1100.        else
  1101.          @spriteset.enemy_sprites[@active_battler.index].enemy_pose(1)
  1102.        end
  1103.      end
  1104.    end
  1105.    @phase4_step = 6
  1106. end

  1107. #--------------------------------------------------------------------------
  1108. # ● フレーム更新 (メインフェーズ ステップ 6 : リフレッシュ)
  1109. #--------------------------------------------------------------------------
  1110. def update_phase4_step6
  1111.    
  1112.    # here we are asking if the player is dead and is a player or an enemy...
  1113.    # these lines are for the running back and standby animation....
  1114.    if @active_battler.is_a?(Game_Actor) and !@active_battler.dead?
  1115.      @spriteset.actor_sprites[@active_battler.index].move(@active_battler.screen_x, @active_battler.screen_y, 20)
  1116.      @spriteset.actor_sprites[@active_battler.index].pose(1)
  1117.    elsif !@active_battler.dead?
  1118.      @spriteset.enemy_sprites[@active_battler.index].move(@active_battler.screen_x, @active_battler.screen_y, 20)
  1119.      @spriteset.enemy_sprites[@active_battler.index].enemy_pose(1)
  1120.    end
  1121.    for target in @target_battlers
  1122.      if target.is_a?(Game_Actor) and !target.dead?
  1123.          @spriteset.actor_sprites[target.index].pose(1)
  1124.        elsif !target.dead?
  1125.          @spriteset.enemy_sprites[target.index].enemy_pose(1)
  1126.      end
  1127.    end
  1128.    $game_temp.forcing_battler = nil
  1129.    if @common_event_id > 0
  1130.      common_event = $data_common_events[@common_event_id]
  1131.      $game_system.battle_interpreter.setup(common_event.list, 0)
  1132.    end
  1133.    @phase4_step = 7
  1134. end

  1135. def update_phase4_step7
  1136.    
  1137.    # here we are asking if the player is dead and is a player or an enemy...
  1138.    # these lines are for the running back and standby animation....
  1139.    if @active_battler.is_a?(Game_Actor) and !@active_battler.dead?
  1140.      @spriteset.actor_sprites[@active_battler.index].pose(1)
  1141.    elsif !@active_battler.dead?
  1142.      @spriteset.enemy_sprites[@active_battler.index].enemy_pose(1)
  1143.    end

  1144.    $game_temp.forcing_battler = nil
  1145. #   if @common_event_id > 0
  1146. #     common_event = $data_common_events[@common_event_id]
  1147. #     $game_system.battle_interpreter.setup(common_event.list, 0)
  1148. #   end
  1149.    @phase4_step = 1
  1150. end
  1151.   
  1152. # this one is an extra... without this the animation whill not work correctly...

  1153. def update
  1154.    if $game_system.battle_interpreter.running?
  1155.      $game_system.battle_interpreter.update
  1156.      if $game_temp.forcing_battler == nil
  1157.        unless $game_system.battle_interpreter.running?
  1158.          unless judge
  1159.            setup_battle_event
  1160.          end
  1161.        end
  1162.        if @phase != 5
  1163.          @status_window.refresh
  1164.        end
  1165.      end
  1166.    end
  1167.    $game_system.update
  1168.    $game_screen.update
  1169.    if $game_system.timer_working and $game_system.timer == 0
  1170.      $game_temp.battle_abort = true
  1171.    end
  1172.    @help_window.update
  1173.    @party_command_window.update
  1174.    @actor_command_window.update
  1175.    @status_window.update
  1176.    @message_window.update
  1177.    @spriteset.update
  1178.    if $game_temp.transition_processing
  1179.      $game_temp.transition_processing = false
  1180.      if $game_temp.transition_name == ""
  1181.        Graphics.transition(20)
  1182.      else
  1183.        Graphics.transition(40, "Graphics/Transitions/" +
  1184.          $game_temp.transition_name)
  1185.      end
  1186.    end
  1187.    if $game_temp.message_window_showing
  1188.      return
  1189.    end
  1190.    if @spriteset.effect?
  1191.      return
  1192.    end
  1193.    if $game_temp.gameover
  1194.      $scene = Scene_Gameover.new
  1195.      return
  1196.    end
  1197.    if $game_temp.to_title
  1198.      $scene = Scene_Title.new
  1199.      return
  1200.    end
  1201.    if $game_temp.battle_abort
  1202.      $game_system.bgm_play($game_temp.map_bgm)
  1203.      battle_end(1)
  1204.      return
  1205.    end
  1206.    if @wait_count > 0
  1207.      @wait_count -= 1
  1208.      return
  1209.    end

  1210.    # this one holds the battle while the player moves
  1211.    for actor in @spriteset.actor_sprites
  1212.      if actor.moving
  1213.        return
  1214.      end
  1215.    end
  1216.    # and this one is for the enemy...
  1217.    for enemy in @spriteset.enemy_sprites
  1218.      if enemy.moving# and $game_system.animated_enemy
  1219.        return
  1220.      end
  1221.    end
  1222.    
  1223.    if $game_temp.forcing_battler == nil and
  1224.       $game_system.battle_interpreter.running?
  1225.      return
  1226.    end
  1227.    case @phase
  1228.    when 1
  1229.      update_phase1
  1230.    when 2
  1231.      update_phase2
  1232.    when 3
  1233.      update_phase3
  1234.    when 4
  1235.      update_phase4
  1236.    when 5
  1237.      update_phase5
  1238.    end
  1239. end

  1240. #==============================================================================
  1241. # here again.... snipplet from RPG's scrîpt
  1242. #==============================================================================


  1243. # this one here is for the winning pose...
  1244. # if you happen to use my old costum level scrîpt then you need to add the
  1245. # marked line to you "def start_phase5" in  "Scene_Battle 2" and delete this one...
  1246. # the ->  =*****=
  1247. # marks the end where you need to delete...
  1248. # and -> {=====}
  1249. # marks the line you need to copy and paste in the other one...
  1250. # you need to add it at the same position...

  1251. #--------------------------------------------------------------------------
  1252. # ● 开始结束战斗回合
  1253. #--------------------------------------------------------------------------
  1254. def start_phase5
  1255.    # 转移到回合 5
  1256.    @phase = 5
  1257.    # 演奏战斗结束 ME
  1258.    $game_system.me_play($game_system.battle_end_me)
  1259.    # 还原为战斗开始前的 BGM
  1260.    $game_system.bgm_play($game_temp.map_bgm)
  1261.    # 初始化 EXP、金钱、宝物
  1262.    @exp = 0
  1263.    gold = 0
  1264.    treasures = []
  1265.    # 循环
  1266.    for enemy in $game_troop.enemies
  1267.      # 敌人不是隐藏状态的情况下
  1268.      unless enemy.hidden
  1269.        # 获得 EXP、增加金钱
  1270.        @exp += enemy.exp
  1271.        gold += enemy.gold
  1272.        # 出现宝物判定
  1273.        if rand(100) < enemy.treasure_prob
  1274.          if enemy.item_id > 0
  1275.            treasures.push($data_items[enemy.item_id])
  1276.          end
  1277.          if enemy.weapon_id > 0
  1278.            treasures.push($data_weapons[enemy.weapon_id])
  1279.          end
  1280.          if enemy.armor_id > 0
  1281.            treasures.push($data_armors[enemy.armor_id])
  1282.          end
  1283.        end
  1284.      end
  1285.    end
  1286.    # 限制宝物数为 6 个
  1287.    treasures = treasures[0..5]
  1288.    # 获得金钱
  1289.    $game_party.gain_gold(gold)
  1290.    # 获得宝物
  1291.    for item in treasures
  1292.      case item
  1293.      when RPG::Item
  1294.        $game_party.gain_item(item.id, 1)
  1295.      when RPG::Weapon
  1296.        $game_party.gain_weapon(item.id, 1)
  1297.      when RPG::Armor
  1298.        $game_party.gain_armor(item.id, 1)
  1299.      end
  1300.    end
  1301.    # 生成战斗结果窗口
  1302.    @result_window = Window_BattleResult.new(@exp, gold, treasures)
  1303.    # 设置等待计数
  1304.    @phase5_wait_count = 10
  1305. end
  1306. #--------------------------------------------------------------------------
  1307. # ● 画面更新 (结束战斗回合)
  1308. #--------------------------------------------------------------------------
  1309. def update_phase5
  1310.    # 等待计数大于 0 的情况下
  1311.    if @phase5_wait_count > 0
  1312.      # 减少等待计数
  1313.      @phase5_wait_count -= 1
  1314.      # 等待计数为 0 的情况下
  1315.      if @phase5_wait_count == 0
  1316. #==================
  1317.     # 准备过渡
  1318.     Graphics.freeze
  1319.     # 生成战斗胜利图形
  1320.     @sprite = Sprite.new
  1321.     @sprite.z = 9999
  1322.     @sprite.bitmap = RPG::Cache.gameover("win")
  1323.     # 执行过渡
  1324.     Graphics.transition(40)
  1325.     @wait_count = 40
  1326.     # 准备过渡
  1327.     Graphics.freeze
  1328.     # 释放战斗胜利图形
  1329.     @sprite.bitmap.dispose
  1330.     # 执行过渡
  1331.     Graphics.transition(40)
  1332. #=======================
  1333.        # 显示结果窗口
  1334.        @result_window.visible = true
  1335.        # 清除主回合标志
  1336.        $game_temp.battle_main_phase = false
  1337.        # 刷新状态窗口
  1338.        @status_window.refresh
  1339.      end
  1340.      return
  1341.    end
  1342.    # 按下 C 键的情况下
  1343.    if Input.trigger?(Input::C)
  1344.      # 关闭结果窗口
  1345.      @result_window.visible = false
  1346.      # 获得 EXP
  1347.      for i in 0...$game_party.actors.size
  1348.        actor = $game_party.actors[i]
  1349.        if actor.cant_get_exp? == false
  1350.          last_level = actor.level
  1351.          actor.exp += @exp
  1352.          if actor.level > last_level
  1353.            @status_window.level_up(i)
  1354.          end
  1355.        end
  1356.      end
  1357.      # 战斗结束
  1358.      battle_end(0)
  1359.    end
  1360. end
  1361. #   =*****=   
  1362. #==============================================================================
  1363. # end of the snipplet
  1364. # if you want the comments that where here just look at the scene_battle 4...
  1365. # i added some comments since RPG hasnt add any....
  1366. #==============================================================================
  1367. end
复制代码

作者: 恐惧剑刃    时间: 2013-8-25 14:33
直接用全动画脚本不就行了
作者: 芯☆淡茹水    时间: 2013-8-25 18:07
建议联系原作者,1400多行的脚本,只是看都需要半天,
作者: sblkhgm    时间: 2013-8-25 23:46
芯☆淡茹水 发表于 2013-8-25 18:07
建议联系原作者,1400多行的脚本,只是看都需要半天,

我只是想让角色的战斗坐标移动到被攻击对象的坐标处  而不是在被攻击对象上显示移动的动画 这样被攻击对象上就可以显示其他组合动画了




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1