Project1

标题: 请达人讲解一下这个脚本 [打印本页]

作者: icogogogo    时间: 2008-7-3 18:22
标题: 请达人讲解一下这个脚本
  1. module MOG_VX02
  2. #Definição da switch que ativa o efeito Wave.  
  3. BB_WAVE_SWITCH = 0
  4. #Definição da switch que ativa a versão VX.
  5. BB_VXEDITION_SWITCH = 0
  6. end
  7. #-------------------------------------------------
  8. $mogscript = {} if $mogscript == nil
  9. $mogscript["battleback_xp"] = true
  10. #-------------------------------------------------
  11. ###############
  12. # Game_System #
  13. ###############
  14. class Game_System
  15. attr_accessor :bb
  16. alias mog_vx02_initialize initialize
  17. def initialize
  18. mog_vx02_initialize
  19. @bb = ""
  20. end
  21. end
  22. ###############
  23. # Module Cache #
  24. ###############
  25. module Cache  
  26.   def self.battleback(filename)
  27.     load_bitmap("Graphics/battlebacks/", filename)
  28.   end
  29. end
  30. #################
  31. # Spriteset_Battle #
  32. #################
  33. class Spriteset_Battle
  34. include MOG_VX02
  35.   def create_battleback
  36.     @battleback_sprite = Sprite.new(@viewport1)
  37.     source = Cache.battleback($game_system.bb.to_s) rescue empty
  38.     if  $game_switches[BB_WAVE_SWITCH] == true
  39.     bitmap = Bitmap.new(640, 480)
  40.     else
  41.     bitmap = Bitmap.new(544, 288)
  42.     end
  43.     bitmap.stretch_blt(bitmap.rect, source, source.rect)
  44.     bitmap.radial_blur(90, 12) if  $game_switches[BB_VXEDITION_SWITCH] == true
  45.     @battleback_sprite.bitmap = bitmap
  46.     wave_on if  $game_switches[BB_WAVE_SWITCH] == true
  47. end
  48. def wave_on
  49.     @battleback_sprite.ox = 320
  50.     @battleback_sprite.oy = 240
  51.     @battleback_sprite.x = 272
  52.     @battleback_sprite.y = 176  
  53.     @battleback_sprite.wave_amp = 8
  54.     @battleback_sprite.wave_length = 240
  55.     @battleback_sprite.wave_speed = 120     
  56. end
  57. def empty
  58.    @battleback_sprite.bitmap =  $game_temp.background_bitmap
  59. end
  60. def create_battlefloor
  61.     if  $game_switches[BB_VXEDITION_SWITCH] == true
  62.     @battlefloor_sprite = Sprite.new(@viewport1)
  63.     @battlefloor_sprite.bitmap = Cache.system("BattleFloor")
  64.     @battlefloor_sprite.x = 0
  65.     @battlefloor_sprite.y = 192
  66.     @battlefloor_sprite.z = 1
  67.     @battlefloor_sprite.opacity = 128
  68.     else
  69.     @battlefloor_sprite = Sprite.new(@viewport1)
  70.     end
  71.   end
  72. end
复制代码


已知是战斗背景的脚本,在事件中输入“ $game_system.bb = "023-FarmVillage01" ”
可以将战斗背景给改为023-FarmVillage01等

我想问的是:在这个脚本中可不可以在事件中临时调用当前地图作为战斗背景

也就是说,我想在一般杂鱼中用当前地图或者VX眩晕效果做背景
                特殊战斗用XP的战斗背景图片

谢谢~




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