设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 2624|回复: 0
打印 上一主题 下一主题

[已经解决] BGS无法播放,和调音量脚本有冲突,求解决……

[复制链接]

Lv2.观梦者

梦石
0
星屑
743
在线时间
2064 小时
注册时间
2011-10-3
帖子
1686
跳转到指定楼层
1
发表于 2012-5-18 17:00:51 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有帐号?注册会员

x
本帖最后由 布里蓝 于 2012-8-9 16:06 编辑
  1. #===============================================================================

  2. # Side-View Battle System(Patch Behind)

  3. # By Jet10985 (Jet)

  4. #===============================================================================

  5. # This script will allow you to have battle where all the actor's sprites are

  6. # display on the behind of the characters.

  7. # This script has: 10 customization options.

  8. #===============================================================================

  9. # Overwritten Methods:

  10. # Scene_Battle: show_attack_animation

  11. # Spriteset_Battle: update_actors

  12. #-------------------------------------------------------------------------------

  13. # Aliased methods:

  14. # Spriteset_Battle: create_actors, create_enemies

  15. # Sprite_Character: initialize, update, dispose, start_new_effect

  16. # Scene_Battle: use_item, next_command, prior_command

  17. # Game_Character: screen_x, screen_y

  18. #===============================================================================


  19. module Jet

  20.   module Sideview


  21.         #===========================================================================

  22.         # ENEMY OPTIONS

  23.         #===========================================================================


  24.         # These are the attack animations for enemies when they use a regular attack.

  25.         # It follows this format: enemy_id => animation_id

  26.         ENEMY_ATK_ANIMS = {



  27.         }


  28.         # This is the default enemy attack animation, used when they do not have a

  29.         # specific attack animation above.

  30.         ENEMY_ATK_ANIMS.default = 1


  31.         # This is a list of enemies whose portraits should be flipped in battle.

  32.         FLIPPED_ENEMIES = [2, 3, 4, 5, 8, 10, 12, 13, 14, 16, 17, 18, 19]


  33.         #===========================================================================

  34.         # ACTOR OPTIONS

  35.         #===========================================================================


  36.         # Should the player sprite have a shadow beneath them?

  37.         PLAYER_SHADOW = true


  38.         # These are sprite changes depending on state infliction.

  39.         # It follows this format: state_id => "sprite_appention"

  40.         # This means if the state is inflicted, the sprite will look for a graphic

  41.         # that is the same name as the character's sprite, plus the appended option.

  42.         # EX: Ralph's sprite's name is $ralph. Ralph gets knocked-out. This means

  43.         # state 1 was inflicted, and my below config for 1 was: 1 => "_dead"

  44.         # Now, his shown sprite will be $ralph_dead. If the sprite does not exist,

  45.         # no change will be made.

  46.         # The sprite index will be the same as the actor's.

  47.         STATE_SPRITES = {


  48.         1 => "_dead",

  49.         2 => "_poison",

  50.         3 => "_blind"


  51.         }


  52.         #===========================================================================

  53.         # GENERAL_OPTIONS

  54.         #===========================================================================


  55.         # This is the animation displayed when a skill is about to be used.

  56.         SKILL_ANIMATION = 43


  57.         # This is the animation displayed when an item is about to be used.

  58.         ITEM_ANIMATION = 43


  59.         # These are the animations played when a state is inflicted.

  60.         # It follows this format: state_id => animation_id

  61.         STATE_ANIMATIONS = {


  62.         1 => 56,

  63.         2 => 50,

  64.         3 => 51


  65.         }


  66.         #===========================================================================

  67.         # FIELD OPTIONS

  68.         #===========================================================================


  69.         # This is where the line-up begins. [x, y]. The higher the x, the further

  70.         # right and the higher the y the further down.

  71.         FIELD_POS = [105, 300]


  72.         # This is how far down, and to the right each player is from the previous

  73.         # actor. [x, y]. Same rules as above.

  74.         FIELD_SPACING = [101, 0]


  75.   end

  76. end


  77. #===============================================================================

  78. # DON'T EDIT FURTHER UNLESS YOU KNOW WHAT TO DO.

  79. #===============================================================================


  80. ($imported ||= {})[:jet] ||= {}

  81. $imported[:jet][:Sideview] =true


  82. class Game_Character


  83.   attr_accessor :step_anime


  84.   %w[screen_x screen_y].each {|a|

  85.         aStr = %Q{

  86.           alias jet6372_#{a} #{a}

  87.           def #{a}(*args, &block)

  88.                 $BTEST ? 0 : jet6372_#{a}(*args, &block)

  89.           end

  90.         }

  91.         module_eval(aStr)

  92.   }

  93. end


  94. class Game_Actor


  95.   def animation_id=(t)
  96.         self.battle_sprite.start_animation($data_animations[t]) rescue nil
  97.   end
  98. end

  99. class Game_Battler


  100.   def battle_sprite

  101.         return nil unless SceneManager.scene_is?(Scene_Battle)

  102.         SceneManager.scene.spriteset.battler_sprites.each {|a|

  103.           return a if a.battler == self

  104.         }

  105.         return nil

  106.   end

  107. end


  108. class Spriteset_Battle


  109.   alias jet2847_create_enemies create_enemies

  110.   def create_enemies(*args, &block)

  111.         jet2847_create_enemies(*args, &block)

  112.         @enemy_sprites.each {|a|

  113.           a.mirror = Jet::Sideview::FLIPPED_ENEMIES.include?(a.battler.enemy.id)

  114.         }

  115.   end


  116.   alias jet3835_create_actors create_actors

  117.   def create_actors(*args, &block)

  118.         jet3835_create_actors(*args, &block)

  119.         @jet_party = $game_party.members

  120.         @actor_sprites.each {|a|

  121.           a.dispose

  122.         }

  123.         @actor_sprites = []
  124.         $game_party.members.each {|a|
  125.           f = Game_Character.new
  126.           f.set_graphic(a.character_name, a.character_index)
  127.           f.step_anime = true
  128.           f.set_direction(8)
  129.           n = Sprite_Character.new(@viewport1, f)
  130.           n.jet_x = Jet::Sideview::FIELD_POS[0] + a.index * Jet::Sideview::FIELD_SPACING[0]
  131.           n.jet_y = Jet::Sideview::FIELD_POS[1] + a.index * Jet::Sideview::FIELD_SPACING[1]
  132.           n.battler = a
  133.           n.battle_sprite = true
  134.           if Jet::Sideview::PLAYER_SHADOW
  135.                 v = Sprite.new(nil)
  136.                 v.bitmap = Cache.system("Shadow")
  137.                 n.shadow_sprite = v
  138.           end
  139.           @actor_sprites.push(n)
  140.         }
  141.   end

  142.   def update_actors
  143.         if @jet_party != $game_party.members
  144.           @actor_sprites.each {|a|
  145.                 a.dispose
  146.           }
  147.           @actor_sprites = []
  148.           create_actors
  149.         end
  150.         @actor_sprites.each {|a| a.update }
  151.   end
  152. end

  153. class Sprite_Character

  154.   attr_accessor :battle_sprite, :jet_x, :jet_y, :shadow_sprite, :battler

  155.   alias jet4646_initialize initialize
  156.   def initialize(*args, &block)

  157.         @battle_sprite = false

  158.         jet4646_initialize(*args, &block)

  159.   end


  160.   alias jet3645_update update

  161.   def update(*args, &block)

  162.         jet3645_update(*args, &block)

  163.         if @battle_sprite

  164.           @character.step_anime = [email protected]?

  165.           @character.update

  166.           self.x = @jet_x

  167.           self.y = @jet_y

  168.           if [email protected]?

  169.                 f = @battler.states.dup

  170.                 f.sort! {|a, b|

  171.                   a.priority <=> b.priority

  172.                 }.reverse!

  173.                 for i in 0...f.size

  174.                   a = Jet::Sideview::STATE_SPRITES[f[i].id]

  175.                   next if a.nil?

  176.                   b = (Cache.character(@character.character_name + a) rescue false)

  177.                   next unless b

  178.                   index = @character.character_index

  179.                   @character.set_graphic(@character.character_name + a, index)

  180.                   break

  181.                 end

  182.           end

  183.           if !@shadow_sprite.nil?

  184.                 @shadow_sprite.x = self.x - @shadow_sprite.width / 2
  185.                 @shadow_sprite.y = self.y - 28
  186.                 @shadow_sprite.visible = self.visible
  187.                 @shadow_sprite.viewport = self.viewport
  188.                 @shadow_sprite.z = self.z - 1
  189.           end
  190.         end
  191.   end

  192.   alias jet5484_dispose dispose
  193.   def dispose(*args, &block)
  194.         @shadow_sprite.dispose if !@shadow_sprite.nil?
  195.         jet5484_dispose(*args, &block)
  196.   end

  197.   def move_x(times, amount)
  198.         i = 0
  199.         until i == times
  200.           self.jet_y += amount
  201.           i += 1
  202.           [Graphics, SceneManager.scene.spriteset].each {|a| a.update }
  203.         end
  204.   end

  205.   def effect?
  206.         false
  207.   end
  208. end

  209. class Game_Enemy

  210.   def atk_animation_id1
  211.         return Jet::Sideview::ENEMY_ATK_ANIMS[@enemy_id]
  212.   end


  213.   def atk_animation_id2

  214.         return 0

  215.   end

  216. end


  217. class Scene_Battle


  218.   attr_reader :spriteset


  219.   alias jet2711_use_item use_item

  220.   def use_item(*args, &block)

  221.         if @subject.is_a?(Game_Actor)

  222.           if [email protected]_action.guard?

  223.                 @subject.battle_sprite.move_x(11, 0)

  224.           end

  225.         end

  226.         if [email protected]_action.guard? && [email protected]_action.attack?

  227.           if @subject.current_action.item.is_a?(RPG::Item)

  228.                 n = $data_animations[Jet::Sideview::ITEM_ANIMATION]

  229.           else

  230.                 n = $data_animations[Jet::Sideview::SKILL_ANIMATION]

  231.           end

  232.           @subject.battle_sprite.start_animation(n)

  233.           wait_for_animation

  234.         end

  235.         jet2711_use_item(*args, &block)

  236.         if @subject.is_a?(Game_Actor)

  237.           if [email protected]_action.guard?

  238.                 @subject.battle_sprite.move_x(11, 0)

  239.           end

  240.         end

  241.   end


  242.   def show_attack_animation(targets)

  243.         aid1 = @subject.atk_animation_id1

  244.         aid2 = @subject.atk_animation_id2

  245.         show_normal_animation(targets, aid1, false)

  246.         show_normal_animation(targets, aid2, true)

  247.   end


  248.   %w[next prior].each {|a|

  249.         aStr = %Q{

  250.           alias jet3734_#{a}_command #{a}_command

  251.           def #{a}_command(*args, &block)

  252.                 f = BattleManager.actor

  253.                 f.battle_sprite.move_x(6, 4) if f.is_a?(Game_Actor)

  254.                 jet3734_#{a}_command(*args, &block)

  255.                 f = BattleManager.actor

  256.                 f.battle_sprite.move_x(6, -4) if f.is_a?(Game_Actor)

  257.           end

  258.         }

  259.         module_eval(aStr)

  260.   }

  261. end


  262. class Game_Action


  263.   def guard?

  264.         item == $data_skills[subject.guard_skill_id]

  265.   end

  266. end


  267. if $imported[:jet][:BattlePopUps]

  268.   class Sprite_Character


  269.         attr_accessor :popups


  270.         alias jet4758_initialize initialize

  271.         def initialize(*args, &block)

  272.           @popups = []

  273.           @updating_sprites = []

  274.           @popup_wait = 0

  275.           jet4758_initialize(*args, &block)

  276.         end


  277.         alias jet7467_update update

  278.         def update(*args, &block)

  279.           jet7467_update(*args, &block)

  280.           if @popup_wait == 0

  281.                 if [email protected]?

  282.                   @updating_sprites.push(@popups.pop)

  283.                   @popup_wait = 30

  284.                 end

  285.           else

  286.                 @popup_wait -= 1

  287.           end

  288.           @updating_sprites.each {|a|

  289.                 a.visible = true if !a.visible

  290.                 a.update

  291.                 @updating_sprites.delete(a) if a.disposed?

  292.           }

  293.         end


  294.         alias jet5483_dispose dispose

  295.         def dispose(*args, &block)

  296.           (@updating_sprites + @popups).each {|a| a.dispose }

  297.           jet5483_dispose(*args, &block)

  298.         end


  299.         alias jet3745_setup_new_effect setup_new_effect

  300.         def setup_new_effect(*args, &block)

  301.           jet3745_setup_new_effect(*args, &block)

  302.           do_sprite_popups

  303.         end


  304.         def make_popup(text, color)

  305.           @popups.unshift(Sprite_JetPopup.new(text.to_s, color, self))

  306.         end


  307.         def do_sprite_popups

  308.           return if @battler.nil?

  309.           if @battler_struct.nil?

  310.                 @battler_struct = Struct.new(:hp, :mp, :tp).new(0, 0, 0)

  311.                 @battler_struct.hp = @battler.hp

  312.                 @battler_struct.mp = @battler.mp

  313.                 @battler_struct.tp = @battler.tp

  314.           end

  315.           check_success_popup

  316.           check_hp_popup

  317.           check_mp_popup

  318.           check_tp_popup

  319.         end


  320.         def check_success_popup

  321.           if @battler.result.success

  322.                 if @battler.result.critical

  323.                   make_popup(Jet::BattlePopUps::CRITICAL_TEXT, Jet::BattlePopUps::CRITICAL_COLOR)

  324.                 elsif @battler.result.missed

  325.                   make_popup(Jet::BattlePopUps::MISSED_TEXT, Jet::BattlePopUps::MISS_COLOR)

  326.                 elsif @battler.result.evaded

  327.                   make_popup(Jet::BattlePopUps::EVADED_TEXT, Jet::BattlePopUps::EVADE_COLOR)

  328.                 end

  329.                 @battler.result.clear_hit_flags

  330.           end

  331.         end


  332.         def check_hp_popup

  333.           if @battler_struct.hp != @battler.hp

  334.                 f = @battler_struct.hp - @battler.hp

  335.                 if f > 0

  336.                   make_popup(Jet::BattlePopUps::HURT_TEXT + f.to_s, Jet::BattlePopUps::HURT_COLOR)

  337.                 elsif f < 0

  338.                   make_popup(Jet::BattlePopUps::HEAL_TEXT + f.abs.to_s, Jet::BattlePopUps::HEAL_COLOR)

  339.                 end

  340.                 @battler_struct.hp = @battler.hp

  341.           end

  342.         end


  343.         def check_mp_popup

  344.           if @battler_struct.mp != @battler.mp

  345.                 f = @battler_struct.mp - @battler.mp

  346.                 if f > 0

  347.                   make_popup(Jet::BattlePopUps::HURT_TEXT_MP + f.to_s, Jet::BattlePopUps::HURT_COLOR_MP)

  348.                 elsif f < 0

  349.                   make_popup(Jet::BattlePopUps::HEAL_TEXT_MP + f.abs.to_s, Jet::BattlePopUps::HEAL_COLOR_MP)
  350.                 end
  351.                 @battler_struct.mp = @battler.mp
  352.           end
  353.         end

  354.         def check_tp_popup
  355.           if @battler_struct.tp != @battler.tp
  356.                 f = (@battler_struct.tp - @battler.tp).round
  357.                 if f > 0
  358.                   make_popup(Jet::BattlePopUps::HURT_TEXT_TP + f.to_s, Jet::BattlePopUps::HURT_COLOR_TP)
  359.                 elsif f < 0
  360.                   make_popup(Jet::BattlePopUps::HEAL_TEXT_TP + f.abs.to_s, Jet::BattlePopUps::HEAL_COLOR_TP)
  361.                 end
  362.                 @battler_struct.tp = @battler.tp
  363.           end
  364.         end
  365.   end
  366. end
复制代码

2.jpg (11.37 KB, 下载次数: 15)

2.jpg

1.jpg (12.13 KB, 下载次数: 12)

1.jpg

点评

我也这问题。。。最后决定删脚本。。。  发表于 2012-5-18 17:08
您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-5-15 02:25

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表