Project1

标题: 改变战斗背景脚本 [打印本页]

作者: zero2    时间: 2008-2-16 22:06
标题: 改变战斗背景脚本

  1. #==============================================================================
  2. # ■ VX-RGSS2 改变战斗背景 [版本.1.0.0]     by Claimh
  3. #------------------------------------------------------------------------------
  4. # 英语翻译 By: Elemental Crisis [http://www.rpgcrisis.net]
  5. # 中文翻译 By: zero2 [http://rpg.blue/web]
  6. #------------------------------------------------------------------------------
  7. # 改变战斗的背景图.
  8. #==============================================================================


  9. module BattleBack
  10. #   选择战斗背景
  11. #   0:当前地图的战斗背景,为战斗背景(默认VX的样式)
  12. #   1:目前使用的地图作为战斗背景
  13. #   2:使用自己的图片,为战斗背景
  14. BB_TYPE = 0  # 在这里输入上面提到的编号

  15. # 显示战斗地面
  16. BT_FLOOR = false

  17. # 使用的图片(如果你选择的编号为2)
  18. M_B_BACK = {
  19.    # 地图编号 => "(Graphics/System/图片名)"
  20.    1 => "001-Grassland01"
  21. }
  22. end


  23. #==============================================================================
  24. # ■ Spriteset_Battle
  25. #==============================================================================
  26. class Spriteset_Battle
  27. #--------------------------------------------------------------------------
  28. # ● Creating Battle Back Sprite
  29. #--------------------------------------------------------------------------
  30. def create_battleback
  31.    case BattleBack::BB_TYPE
  32.    when 0
  33.      source = $game_temp.background_bitmap
  34.      bitmap = Bitmap.new(640, 480)
  35.      bitmap.stretch_blt(bitmap.rect, source, source.rect)
  36.      bitmap.radial_blur(90, 12)
  37.      @battleback_sprite = Sprite.new(@viewport1)
  38.      @battleback_sprite.bitmap = bitmap
  39.      @battleback_sprite.ox = 320
  40.      @battleback_sprite.oy = 240
  41.      @battleback_sprite.x = 272
  42.      @battleback_sprite.y = 176
  43.      @battleback_sprite.wave_amp = 8
  44.      @battleback_sprite.wave_length = 240
  45.      @battleback_sprite.wave_speed = 120
  46.    when 1
  47.      source = $game_temp.background_bitmap
  48.      bitmap = Bitmap.new(640, 480)
  49.      bitmap.stretch_blt(bitmap.rect, source, source.rect)
  50.      @battleback_sprite = Sprite.new(@viewport1)
  51.      @battleback_sprite.bitmap = bitmap
  52.      @battleback_sprite.ox = 320
  53.      @battleback_sprite.oy = 240
  54.      @battleback_sprite.x = 272
  55.      @battleback_sprite.y = 176
  56.    when 2
  57.      @battleback_sprite = BattleBackSprite.new(@viewport1)
  58.    end
  59. end
  60. #--------------------------------------------------------------------------
  61. # ● Creating Battle Floor Sprite
  62. #--------------------------------------------------------------------------
  63. alias create_battlefloor_mbb create_battlefloor
  64. def create_battlefloor
  65.    create_battlefloor_mbb if BattleBack::BT_FLOOR
  66. end
  67. #--------------------------------------------------------------------------
  68. # ● Delete Battle Floor Sprite
  69. #--------------------------------------------------------------------------
  70. alias dispose_battlefloor_mbb dispose_battlefloor
  71. def dispose_battlefloor
  72.    dispose_battlefloor_mbb if BattleBack::BT_FLOOR
  73. end
  74. #--------------------------------------------------------------------------
  75. # ● Update Battle Floor Sprite
  76. #--------------------------------------------------------------------------
  77. alias update_battlefloor_mbb update_battlefloor
  78. def update_battlefloor
  79.    update_battlefloor_mbb if BattleBack::BT_FLOOR
  80. end
  81. end


  82. #==============================================================================
  83. # ■ BattleBackSprite
  84. #==============================================================================
  85. class BattleBackSprite < Sprite
  86. # Background Screen Size
  87. WIDTH  = 544.00
  88. HEIGHT = 288.00
  89. #--------------------------------------------------------------------------
  90. # ● Object Initialization
  91. #     viewport : viewport
  92. #--------------------------------------------------------------------------
  93. def initialize(viewport = nil)
  94.    super(viewport)
  95.    self.bitmap = Cache.system(BattleBack::M_B_BACK[$game_map.map_id])
  96.    # Zoom is carried out according to picture size.
  97.    @x_zoom = WIDTH / self.bitmap.width
  98.    @y_zoom = HEIGHT / self.bitmap.height
  99.    @zoom = @x_zoom > @y_zoom ? @x_zoom : @y_zoom
  100.    # Zoom is carried out.
  101.    self.zoom_x = @zoom
  102.    self.zoom_y = @zoom
  103.    # Made into central display.
  104.    self.ox = self.bitmap.width / 2
  105.    self.oy = self.bitmap.height / 2
  106.    self.x = (self.bitmap.width / 2)  * @zoom
  107.    self.y = (self.bitmap.height / 2) * @zoom
  108. end
  109. end
复制代码

作者: 越前リョーマ    时间: 2008-2-16 23:55
复原XP……{/hx}
作者: 纯  小白    时间: 2010-8-14 12:19
提示: 作者被禁止或删除 内容自动屏蔽
作者: q375430574    时间: 2010-8-14 14:15
提示: 作者被禁止或删除 内容自动屏蔽




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