Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # animation huge swap scriplet
- # goes below ANIMATIONS in the battle system section
- HUGE_FILENAMES_PARSE = ["1zelos", "1champion_blue", "1zweihander_blue", "1diana", "1champion_blue", "1hussar_blue", "0phases", "1scout_blue", "1valkyrie_blue", "1knight_blue"]
- # all these filenames will be swapped for their _huge counterparts on animations
- class RPG::Animation
- alias animation1_name_unswapped animation1_name
- alias animation2_name_unswapped animation2_name
- def animation1_name
- parse_animation_name unless @animation_name_parsed
- animation1_name_unswapped
- end
- def animation2_name
- parse_animation_name unless @animation_name_parsed
- animation2_name_unswapped
- end
- def parse_animation_name
- @animation_name_parsed = true
- #p @animation1_name
- if HUGE_FILENAMES_PARSE.include?(@animation1_name)
- @animation1_name << "_huge"
- end
- if HUGE_FILENAMES_PARSE.include?(@animation2_name)
- @animation2_name << "_huge"
- end
- end
- end
- class Sprite_Base
- def animation_set_sprites(frame)
- cell_data = frame.cell_data
- @ani_sprites.each_with_index do |sprite, i|
- next unless sprite
- pattern = cell_data[i, 0]
- if !pattern || pattern < 0
- sprite.visible = false
- next
- end
- sprite.bitmap = pattern < 100 ? @ani_bitmap1 : @ani_bitmap2
- frame_width = get_frame_width(sprite)
- p frame_width
- sprite.visible = true
- sprite.src_rect.set(pattern % 5 * frame_width,
- pattern % 100 / 5 * frame_width, frame_width, frame_width)
- if @ani_mirror
- sprite.x = @ani_ox - cell_data[i, 1]
- sprite.y = @ani_oy + cell_data[i, 2]
- sprite.angle = (360 - cell_data[i, 4])
- sprite.mirror = (cell_data[i, 5] == 0)
- else
- sprite.x = @ani_ox + cell_data[i, 1]
- sprite.y = @ani_oy + cell_data[i, 2]
- sprite.angle = cell_data[i, 4]
- sprite.mirror = (cell_data[i, 5] == 1)
- end
- sprite.z = self.z + 300 + i
- sprite.ox = frame_width / 2
- sprite.oy = frame_width / 2
- sprite.zoom_x = cell_data[i, 3] / 100.0
- sprite.zoom_y = cell_data[i, 3] / 100.0
- sprite.opacity = cell_data[i, 6] * self.opacity / 255.0
- sprite.blend_type = cell_data[i, 7]
- end
- end
- def get_frame_width(sprite)
- if sprite.bitmap && !sprite.bitmap.disposed?
- sprite.bitmap.width / 5
- else
- 192
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement