Cerberuser

Untitled

Sep 16th, 2015
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 1.33 KB | None | 0 0
  1. $game_animations = load_data("Data/Animations.rvdata2")
  2. (116..118).each { |i|
  3.   anim = $game_animations[i-1].clone
  4.   anim.frames = $game_animations[i-1].frames.clone
  5.   anim.frames.each_index {|m|
  6.     #anim.frames[i] = anim.frames[i].clone
  7.     f = anim.frames[m]
  8.     f.cell_data = f.cell_data.clone
  9.     (0..7).each {|cell|
  10.       next unless f.cell_data[cell, 0]
  11.       next if f.cell_data[cell, 0] < 0
  12.       x = f.cell_data[cell, 2]
  13.       y = f.cell_data[cell, 1]
  14.       p [[f.cell_data[cell, 1], f.cell_data[cell, 2]], [x, y]]
  15.       if (i % 2 == 0)
  16.         x = -x
  17.       else
  18.         y = -y
  19.       end
  20.       f.cell_data[cell, 1] = x
  21.       f.cell_data[cell, 2] = y
  22.       p [[f.cell_data[cell, 1], f.cell_data[cell, 2]], [x, y]]
  23.       anim.frames[m] = f
  24.     }
  25.     p ["After all cells", [f.cell_data[0, 1], f.cell_data[0, 2]]]
  26.     p ["Block end", anim.frames[0].cell_data[0, 1], anim.frames[0].cell_data[0, 2]]
  27.   }
  28.   p ["After block", anim.frames[0].cell_data[0, 1], anim.frames[0].cell_data[0, 2]]
  29.   anim.name = $game_animations[i].name
  30.   $game_animations[i] = anim.clone
  31.   p [$game_animations[i].frames[0].cell_data[0, 1], $game_animations[i].frames[0].cell_data[0, 2]]
  32.   p [$game_animations[i-1].frames[0].cell_data[0, 1], $game_animations[i-1].frames[0].cell_data[0, 2]]
  33. }
  34. save_data($game_animations, "Data/Animations.rvdata2")
Advertisement
Add Comment
Please, Sign In to add comment