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

Project1

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

怎么样更改VX的战斗背景?

 关闭 [复制链接]
头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
0 小时
注册时间
2006-4-23
帖子
53
跳转到指定楼层
1
发表于 2008-6-1 18:34:11 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
提示: 作者被禁止或删除 内容自动屏蔽

Lv2.观梦者

神隐的主犯

梦石
0
星屑
283
在线时间
271 小时
注册时间
2008-2-22
帖子
7691

贵宾

2
发表于 2008-6-1 18:34:44 | 只看该作者
  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 = 1  # 在这里输入上面提到的编号

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

  17. # 使用的图片(如果你选择的编号为2)
  18. M_B_BACK = {
  19.   # 地图编号 => "(Graphics/System/图片名)"
  20.   71 => "Sea",
  21.   72 => "Sea of clouds"
  22. }
  23. end


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


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



横版战斗脚本:

http://rpgyz.ttsite.com/read.php?tid-7644048.html
系统信息:本贴由楼主认可为正确答案,66RPG感谢您的热情解答~

《天空之城 —— 破碎的命运》
回复 支持 反对

使用道具 举报

头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
0 小时
注册时间
2006-4-23
帖子
53
3
 楼主| 发表于 2008-6-1 18:37:45 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
回复 支持 反对

使用道具 举报

头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
0 小时
注册时间
2006-4-23
帖子
53
4
 楼主| 发表于 2008-6-1 18:40:52 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
回复 支持 反对

使用道具 举报

Lv2.观梦者

神隐的主犯

梦石
0
星屑
283
在线时间
271 小时
注册时间
2008-2-22
帖子
7691

贵宾

5
发表于 2008-6-1 18:42:23 | 只看该作者
以下引用天翼のRAVE于2008-6-1 10:40:52的发言:


哇~全都要脚本..好像还是xp方便一点

他用脚本,那我在不同的怪物是要不同的对战图,这也可以么?好象个脚本不太看得明白怎么使用555...


脚本里有说明,请仔细看下。 “不同的怪物是要不同的对战图” 又用默认的就可以了。

《天空之城 —— 破碎的命运》
回复 支持 反对

使用道具 举报

头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
0 小时
注册时间
2006-4-23
帖子
53
6
 楼主| 发表于 2008-6-1 18:46:47 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
回复 支持 反对

使用道具 举报

Lv2.观梦者

神隐的主犯

梦石
0
星屑
283
在线时间
271 小时
注册时间
2008-2-22
帖子
7691

贵宾

7
发表于 2008-6-1 18:51:53 | 只看该作者
这个要改的话,改的地方比较多哦。LZ会改脚本么?

不如用用这个:

《公主越狱记》里的脚本,插入到Main前:

  1. #==============================================================================
  2. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  3. #==============================================================================
  4. #==============================================================================
  5. # ■ VX-RGSS2-6 サイドビュー戦闘[Formation] [Ver.1.0.1]       by Claimh
  6. #------------------------------------------------------------------------------
  7. # English Translation By: Elemental Crisis [http://www.rpgcrisis.net]
  8. #------------------------------------------------------------------------------
  9. #  Actor location [Formation]
  10. #  The same amount of damage will be given regardless of formation setup.
  11. #==============================================================================

  12. module Battle_Formation
  13. #------------------------------------------------------------------------------
  14.   # [Formation Setup]
  15.   #   $game_system.battle_formation = Formation ID
  16.   #   It’s possible to change the formation (Even an event script is possible).
  17.   FORM = {
  18.     # Formation ID => [[Member 1 x、y], [Member2 x, y],
  19.     #            [Member 3 x, y], [Member 4 x, y]]
  20.     0 => [[380,150], [400, 230], [460, 170], [480, 250]]
  21.   }
  22. #------------------------------------------------------------------------------
  23. end

  24. #==============================================================================
  25. # ■ Game_System
  26. #==============================================================================
  27. class Game_System
  28.   attr_accessor :battle_formation                # Formation ID
  29.   #--------------------------------------------------------------------------
  30.   # ● オブジェクト初期化
  31.   #--------------------------------------------------------------------------
  32.   alias init_game_system initialize
  33.   def initialize
  34.     init_game_system
  35.     @battle_formation = 0              # Initial formation
  36.   end
  37. end

  38. #==============================================================================
  39. # ■ Game_Actor
  40. #==============================================================================
  41. class Game_Actor < Game_Battler
  42.   #--------------------------------------------------------------------------
  43.   # ● Are sprites used? [Redefinition]
  44.   #--------------------------------------------------------------------------
  45.   def use_sprite?
  46.     return true
  47.   end
  48.   #--------------------------------------------------------------------------
  49.   # ● Battle Screen Acquiring X Coordinate
  50.   #--------------------------------------------------------------------------
  51.   def screen_x
  52.     return Battle_Formation::FORM[$game_system.battle_formation][self.index][0]
  53.   end
  54.   #--------------------------------------------------------------------------
  55.   # ● Battle Screen Acquiring Y Coordinate
  56.   #--------------------------------------------------------------------------
  57.   def screen_y
  58.     return Battle_Formation::FORM[$game_system.battle_formation][self.index][1]
  59.   end
  60.   #--------------------------------------------------------------------------
  61.   # ● Battle Screen Acquiring Z Coordinate
  62.   #--------------------------------------------------------------------------
  63.   def screen_z
  64.     bitmap = Cache.character(self.character_name)
  65.     # Height + Y Coordinates
  66.     return screen_y + bitmap.height / 4
  67.   end
  68. end



  69. #==============================================================================
  70. # ■ Game_Enemy
  71. #==============================================================================
  72. class Game_Enemy < Game_Battler
  73.   #--------------------------------------------------------------------------
  74.   # ● Battle Screen Acquiring Z Coordinate  [Redefinition]
  75.   #--------------------------------------------------------------------------
  76.   def screen_z
  77.     bitmap = Cache.battler(self.battler_name, self.battler_hue)
  78.     # Height + Y Coordinates
  79.     return screen_y + bitmap.height
  80.   end
  81. end

  82. #==============================================================================
  83. # ■ VX-RGSS2-6 サイドビュー戦闘[MotionCtrl] [Ver.1.0.1]     by Claimh
  84. #------------------------------------------------------------------------------
  85. # English Translation By: Elemental Crisis [http://www.rpgcrisis.net]
  86. #------------------------------------------------------------------------------
  87. #  This script carries out the movement controls of the actors.
  88. #==============================================================================

  89. #==============================================================================
  90. # ■ Scene_Battle
  91. #==============================================================================
  92. class Scene_Battle < Scene_Base
  93.   #--------------------------------------------------------------------------
  94.   # ●  Battle Start Process
  95.   #--------------------------------------------------------------------------
  96.   alias process_battle_start_sideview process_battle_start
  97.   def process_battle_start
  98.     for battler in $game_party.members + $game_troop.members
  99.       battler.move_mode = SideView::M_MODE_WAIT
  100.     end
  101.     process_battle_start_sideview
  102.   end
  103.   #--------------------------------------------------------------------------
  104.   # ● Victory Process
  105.   #--------------------------------------------------------------------------
  106.   alias process_victory_sideview process_victory
  107.   def process_victory
  108.     for actor in $game_party.members
  109.       actor.move_mode = SideView::M_MODE_WIN
  110.     end
  111.     process_victory_sideview
  112.   end
  113.   #--------------------------------------------------------------------------
  114.   # ● Wait Until Motion Control Is Finished
  115.   #--------------------------------------------------------------------------
  116.   def wait_for_motion
  117.     while @active_battler.motion_stop
  118.       update_basic
  119.     end
  120.   end
  121.   #--------------------------------------------------------------------------
  122.   # ● Execute Combat Operations: Attack [Redefinition]
  123.   #--------------------------------------------------------------------------
  124.   def execute_action_attack
  125.     text = sprintf(Vocab::DoAttack, @active_battler.name)
  126.     @message_window.add_instant_text(text)
  127.     targets = @active_battler.action.make_targets
  128.     #---Enemy attack sound reproduced.
  129.     if @active_battler.is_a?(Game_Enemy)
  130.       Sound.play_enemy_attack
  131.       wait(15, true)
  132.     end
  133.     #--- Proximity (Going)
  134.     SideView.set_target_point(@active_battler, targets[0])
  135.     @active_battler.move_mode = SideView::M_MODE_ATK1
  136.     @active_battler.motion_stop = true
  137.     wait_for_motion
  138.     #--- Attack
  139.     wait(5)
  140.     @active_battler.move_mode = SideView::M_MODE_ATK2
  141.     #---
  142.     display_attack_animation(targets)
  143.     wait(20)
  144.     for target in targets
  145.       target.attack_effect(@active_battler)
  146.       display_action_effects(target)
  147.     end
  148.     #--- Proximity (Return)
  149.     @active_battler.move_mode = SideView::M_MODE_ATK3
  150.     @active_battler.motion_stop = true
  151.     wait_for_motion
  152.     #---Wait
  153.     for target in targets
  154.       target.move_mode = SideView::M_MODE_WAIT
  155.     end
  156.     @active_battler.move_mode = SideView::M_MODE_WAIT
  157.     #---
  158.   end
  159.   #--------------------------------------------------------------------------
  160.   # ● Execute Combat Operations: Skill [Redefinition]
  161.   #--------------------------------------------------------------------------
  162.   def execute_action_skill
  163.     skill = @active_battler.action.skill
  164.     text = @active_battler.name + skill.message1
  165.     @message_window.add_instant_text(text)
  166.     unless skill.message2.empty?
  167.       wait(10)
  168.       @message_window.add_instant_text(skill.message2)
  169.     end
  170.     #--- Enemy attack sound reproduced.
  171.     if @active_battler.is_a?(Game_Enemy)
  172.       Sound.play_enemy_attack
  173.       wait(15, true)
  174.     end
  175.     #--- Long distance attack.
  176.     @active_battler.move_mode = SideView::M_MODE_MAGI
  177.     #---
  178.     targets = @active_battler.action.make_targets
  179.     display_animation(targets, skill.animation_id)
  180.     @active_battler.mp -= @active_battler.calc_mp_cost(skill)
  181.     $game_temp.common_event_id = skill.common_event_id
  182.     for target in targets
  183.       target.skill_effect(@active_battler, skill)
  184.       display_action_effects(target, skill)
  185.     end
  186.     #---Wait
  187.     for target in targets
  188.       target.move_mode = SideView::M_MODE_WAIT
  189.     end
  190.     @active_battler.move_mode = SideView::M_MODE_WAIT
  191.     #---
  192.   end
  193.   #--------------------------------------------------------------------------
  194.   # Execute Combat Operations: Item [Redefinition]
  195.   #--------------------------------------------------------------------------
  196.   def execute_action_item
  197.     item = @active_battler.action.item
  198.     text = sprintf(Vocab::UseItem, @active_battler.name, item.name)
  199.     @message_window.add_instant_text(text)
  200.     #--- Enemy attack sound reproduced.
  201.     if @active_battler.is_a?(Game_Enemy)
  202.       Sound.play_enemy_attack
  203.       wait(15, true)
  204.     end
  205.     #--- Long distance attack
  206.     @active_battler.move_mode = SideView::M_MODE_MAGI
  207.     #---
  208.     targets = @active_battler.action.make_targets
  209.     display_animation(targets, item.animation_id)
  210.     $game_party.consume_item(item)
  211.     $game_temp.common_event_id = item.common_event_id
  212.     for target in targets
  213.       target.item_effect(@active_battler, item)
  214.       display_action_effects(target, item)
  215.     end
  216.     #---Wait
  217.     for target in targets
  218.       target.move_mode = SideView::M_MODE_WAIT
  219.     end
  220.     @active_battler.move_mode = SideView::M_MODE_WAIT
  221.     #---
  222.   end
  223.   #--------------------------------------------------------------------------
  224.   # ● Attack Animation Display [Redefinition]
  225.   #     Targets : Object's Arrangement
  226.   #--------------------------------------------------------------------------
  227.   # 【Changed part】
  228.   #  Enemy sound effect is changed so it can be used in each phase of operation.
  229.   #  It changes so that the attack animation of an enemy can be displayed.
  230.   #--------------------------------------------------------------------------
  231.   def display_attack_animation(targets)
  232.     display_normal_animation(targets, @active_battler.atk_animation_id, false)
  233.     display_normal_animation(targets, @active_battler.atk_animation_id2, true)
  234.     wait_for_animation
  235.   end
  236.   #--------------------------------------------------------------------------
  237.   # ● HP Damage display [Redefinition]
  238.   #    Target : Candidate
  239.   #    object : Skill or item
  240.   #--------------------------------------------------------------------------
  241.   def display_hp_damage(target, obj = nil)
  242.     if target.hp_damage == 0                # No damage
  243.       return if obj != nil and obj.damage_to_mp
  244.       return if obj != nil and obj.base_damage == 0
  245.       fmt = target.actor? ? Vocab::ActorNoDamage : Vocab::EnemyNoDamage
  246.       text = sprintf(fmt, target.name)
  247.     elsif target.absorbed                   # Absorption
  248.       fmt = target.actor? ? Vocab::ActorDrain : Vocab::EnemyDrain
  249.       text = sprintf(fmt, target.name, Vocab::hp, target.hp_damage)
  250.     elsif target.hp_damage > 0              # Damage
  251.       if target.actor?
  252.         text = sprintf(Vocab::ActorDamage, target.name, target.hp_damage)
  253.         Sound.play_actor_damage
  254.         $game_troop.screen.start_shake(5, 5, 10)
  255.         target.blink = true # Only adds here
  256.       else
  257.         text = sprintf(Vocab::EnemyDamage, target.name, target.hp_damage)
  258.         Sound.play_enemy_damage
  259.         target.blink = true
  260.       end
  261.     else                                    # Recovery
  262.       fmt = target.actor? ? Vocab::ActorRecovery : Vocab::EnemyRecovery
  263.       text = sprintf(fmt, target.name, Vocab::hp, -target.hp_damage)
  264.       Sound.play_recovery
  265.     end
  266.     @message_window.add_instant_text(text)
  267.     wait(30)
  268.   end
  269. end

  270. #==============================================================================
  271. # ■ VX-RGSS2-6 サイドビュー戦闘[MotionExe] [Ver.1.0.1]     by Claimh
  272. #------------------------------------------------------------------------------
  273. # English Translation By: Elemental Crisis [http://www.rpgcrisis.net]
  274. #------------------------------------------------------------------------------
  275. #  This script executes movement controls of the actors.
  276. #==============================================================================

  277. module SideView
  278. #----------------------------------------------------------------------------
  279.   #-----[Operation Setup]-----
  280.   # Operation Speed
  281.   MOTION_SPEED = 20

  282.   #-----[アニメーション設定]-----
  283.   # Usual enemy attack animation setup.
  284.   E_ANIME = {
  285.    # EnemyID => [Usually atttack and additional attack animations.]
  286.     1 => [1, 0]
  287.   }

  288. #----------------------------------------------------------------------------
  289. #----------------------------------------------------------------------------
  290.   # Motion Control Mode
  291.   M_MODE_WAIT = 0     # Standby
  292.   M_MODE_MAGI = 1     # Attack
  293.   M_MODE_DAMG = 2     # Non-Damage Attack
  294.   M_MODE_WIN  = 3     # Victory
  295.   M_MODE_ATK1 = 4     # Direct Attack (Approaching)
  296.   M_MODE_ATK2 = 5     # Direct Attack (Attacking)
  297.   M_MODE_ATK3 = 6     # Direct Attack (Returning)

  298.   module_function
  299.   #--------------------------------------------------------------------------
  300.   # ● Movement-Zone Calculation
  301.   #--------------------------------------------------------------------------
  302.   def set_target_point(attacker, target)
  303.     case target
  304.     when Game_Actor
  305.       bits = Cache.character(target.character_name)
  306.       attacker.target_x = target.screen_x + (bits.width / 8)
  307.       attacker.target_y = target.screen_y
  308.     when Game_Enemy
  309.       bits = Cache.battler(target.battler_name, target.battler_hue)
  310.       attacker.target_x = target.screen_x + (bits.width / 2)
  311.       attacker.target_y = target.screen_y
  312.     end
  313.   end
  314. end

  315. class Game_Battler
  316.   attr_accessor   :move_mode       # Operation Mode
  317.   # 0:Standby   1:Attack   2: Un-useless   3:Victory
  318.   attr_accessor   :motion_stop     # Operation Stop Flag (Under Movement Flag)
  319.   attr_accessor   :target_x        # Move Position(x)
  320.   attr_accessor   :target_y        # Move Position(y)
  321.   #--------------------------------------------------------------------------
  322.   # ● Object Initialization
  323.   #--------------------------------------------------------------------------
  324.   alias initialize_sdva_corpse initialize
  325.   def initialize
  326.     initialize_sdva_corpse
  327.     @move_mode = 0
  328.     @motion_stop = false
  329.     @target_x = 0
  330.     @target_y = 0
  331.   end
  332. end

  333. #==============================================================================
  334. # ■ Game_Enemy
  335. #==============================================================================
  336. class Game_Enemy < Game_Battler
  337.   #--------------------------------------------------------------------------
  338.   # ● Attack Animation ID Acquisition
  339.   #--------------------------------------------------------------------------
  340.   def atk_animation_id
  341.     return 0 if SideView::E_ANIME[@enemy_id].nil?
  342.     return SideView::E_ANIME[@enemy_id][0]
  343.   end
  344.   #--------------------------------------------------------------------------
  345.   # ● Attack Animation ID Acquisition  (2 Sword Style : 2 Weapons )
  346.   #--------------------------------------------------------------------------
  347.   def atk_animation_id2
  348.     return 0 if SideView::E_ANIME[@enemy_id].nil?
  349.     return SideView::E_ANIME[@enemy_id][1]
  350.   end
  351. end



  352. #==============================================================================
  353. # ■ Sprite_Battler
  354. #==============================================================================
  355. class Sprite_Battler < Sprite_Base
  356.   #--------------------------------------------------------------------------
  357. # ● Object Initialization
  358. #     Viewport : View Port
  359. #     Battler  : Battler (Game_Battler)
  360.   #--------------------------------------------------------------------------
  361.   alias initialize_sideview initialize
  362.   def initialize(viewport, battler = nil)
  363.     initialize_sideview(viewport, battler)
  364.     init_direct_attack
  365.   end
  366.   #--------------------------------------------------------------------------
  367.   # ● Set Proximity Value For Attack
  368.   #--------------------------------------------------------------------------
  369.   def init_direct_attack
  370.     @direct_attack_cnt = 0
  371.     @direct_attack_phase = 0
  372.     @direct_move_cnt = 0
  373.     @battler_x_plus = 0
  374.     @battler_y_plus = 0
  375.     @moving_mode = 0
  376.     @pattern = 0
  377.     @direction = 0
  378.   end
  379.   #--------------------------------------------------------------------------
  380.   # ● Frame Renewal [Redefinition]
  381.   #--------------------------------------------------------------------------
  382.   def update
  383.     super
  384.     if @battler == nil
  385.       self.bitmap = nil
  386.     else
  387.       @use_sprite = @battler.use_sprite?
  388.       if @use_sprite
  389.         self.x = @battler.screen_x + @battler_x_plus
  390.         self.y = @battler.screen_y + @battler_y_plus
  391.         self.z = @battler.screen_z
  392.         update_battler_bitmap
  393.       end
  394.       setup_new_effect
  395.       update_effect
  396.     end
  397.   end
  398.   #--------------------------------------------------------------------------
  399.   # ● Bitmap Transfer Source Renewal
  400.   #--------------------------------------------------------------------------
  401.   alias update_battler_bitmap_sideview update_battler_bitmap
  402.   def update_battler_bitmap
  403.     case @battler
  404.     when Game_Actor
  405.       if @battler.character_name != @battler_name or
  406.          @battler.character_index != @battler_hue
  407.         @battler_name = @battler.character_name
  408.         @battler_hue = @battler.character_index
  409.         draw_pre_character
  410.         draw_character
  411.         if (@battler.dead? or @battler.hidden)
  412.           self.opacity = 0
  413.         end
  414.       end
  415.     when Game_Enemy
  416.       if @battler.battler_name != @battler_name or
  417.          @battler.battler_hue != @battler_hue
  418.         @battler_name = @battler.battler_name
  419.         @battler_hue = @battler.battler_hue
  420.         draw_battler
  421.         if (@battler.dead? or @battler.hidden)
  422.           self.opacity = 0
  423.         end
  424.       end
  425.     end
  426.     motion_control
  427.   end
  428.   #--------------------------------------------------------------------------
  429.   # ● Battler Drawing
  430.   #--------------------------------------------------------------------------
  431.   def draw_battler
  432.     self.bitmap = Cache.battler(@battler_name, @battler_hue)
  433.     @width = bitmap.width
  434.     @height = bitmap.height
  435.     self.ox = @width / 2
  436.     self.oy = @height
  437.   end
  438.   #--------------------------------------------------------------------------
  439.   # ● Pre-Character Drawing [Common]
  440.   #--------------------------------------------------------------------------
  441.   def draw_pre_character
  442.     self.bitmap = Cache.character(@battler_name)
  443.     sign = @battler_name[/^[\!\$]./]
  444.     if sign != nil and sign.include?('$')
  445.       @width = bitmap.width / 3
  446.       @height = bitmap.height / 4
  447.     else
  448.       @width = bitmap.width / 12
  449.       @height = bitmap.height / 8
  450.     end
  451.     self.ox = @width / 2
  452.     self.oy = @height
  453.   end
  454.   #--------------------------------------------------------------------------
  455.   # ● Character Drawing [Common]
  456.   #--------------------------------------------------------------------------
  457.   def draw_character
  458.     index = @battler_hue
  459.     pattern = @pattern < 3 ? @pattern : 1
  460.     sx = (index % 4 * 3 + pattern) * @width
  461.     sy = (index / 4 * 4 + (@direction - 2) / 2) * @height
  462.     self.src_rect.set(sx, sy, @width, @height)
  463.   end
  464.   #--------------------------------------------------------------------------
  465.   # ● Motion Control
  466.   #--------------------------------------------------------------------------
  467.   def motion_control
  468.     # Memory Operation Mode
  469.     @moving_mode = @battler.move_mode
  470.     # Battler Drawing
  471.     case @battler
  472.     when Game_Actor # Actor
  473.       actor_motion_control
  474.     when Game_Enemy # Enemy
  475.       enemy_motion_control
  476.     end
  477.   end
  478.   #--------------------------------------------------------------------------
  479.   # ● Motion Control (Actor)
  480.   #--------------------------------------------------------------------------
  481.   def actor_motion_control
  482.     # Operation Change
  483.     case @moving_mode
  484.     when SideView::M_MODE_WAIT  # Standby
  485.       init_direct_attack
  486.       @battler_x_plus = 0
  487.       @direction = 4
  488.       @pattern = 1
  489.     when SideView::M_MODE_MAGI  # Attack
  490.       @battler_x_plus = -10
  491.       @direction = 4
  492.       @pattern = 3
  493.     when SideView::M_MODE_DAMG  # Non-Damage Attack
  494.       @battler_x_plus = 10
  495.       @direction = 4
  496.       @pattern = 3
  497.     when SideView::M_MODE_WIN  # Victory
  498.       @direction = 2
  499.       @pattern = 1
  500.     when SideView::M_MODE_ATK1  # Direct Attack (Approaching)
  501.       exe_moving_attack_start
  502.       @end_pos_x = @battler_x_plus
  503.     when SideView::M_MODE_ATK2  # Direct Attack (Attacking)
  504.       @battler_x_plus = @end_pos_x - 10
  505.     when SideView::M_MODE_ATK3  # Direct Attack (Returning)
  506.       exe_moving_attack_end
  507.     else
  508.       p "error:Sprite_Battler>> @moving_mode"
  509.     end
  510.     draw_character
  511.   end
  512.   #--------------------------------------------------------------------------
  513.   # ● Motion Control (Enemy)
  514.   #--------------------------------------------------------------------------
  515.   def enemy_motion_control
  516.     # Operation Change
  517.     case @moving_mode
  518.     when SideView::M_MODE_WAIT  # Standby
  519.       init_direct_attack
  520.     when SideView::M_MODE_MAGI  # Attack
  521.       @battler_x_plus = 10
  522.     when SideView::M_MODE_DAMG  # Non-Damage Attack
  523.       @battler_x_plus = -10
  524.       @shake_flg = true
  525.     when SideView::M_MODE_ATK1  # Direct Attack (Approaching)
  526.       exe_moving_attack_start
  527.       @end_pos_x = @battler_x_plus
  528.     when SideView::M_MODE_ATK2  # Direct Attack (Attacking)
  529.       @battler_x_plus = @end_pos_x + 10
  530.     when SideView::M_MODE_ATK3  # Direct Attack (Returning)
  531.       exe_moving_attack_end
  532.     else
  533.       p "error:Sprite_Battler>> @moving_mode", @moving_mode
  534.     end
  535.   end
  536.   #--------------------------------------------------------------------------
  537.   # ● Proximity Attack Execution Method
  538.   #--------------------------------------------------------------------------
  539.   def exe_moving_attack_start
  540.     return unless @battler.motion_stop
  541.     case @direct_attack_phase
  542.     when 0  # Start Operation Preparation
  543.       diratk_start
  544.     when 1  # Move Operation (Going)
  545.       diratk_move
  546.     when 2  # After-Movement Wait
  547.       diratk_wait
  548.     end
  549.   end
  550.   def exe_moving_attack_end
  551.     case @direct_attack_phase
  552.     when 0  # Attack Operation
  553.       diratk_attack
  554.     when 1  # Move Operation (Return)
  555.       diratk_back
  556.     when 2  # Operation End
  557.       diratk_end
  558.     end
  559.   end
  560.   #--------------------------------------------------------------------------
  561.   # ● Proximity Attack Execution [Start Operation Preparation]
  562.   #--------------------------------------------------------------------------
  563.   def diratk_start
  564.     # Pose Change
  565.     @pattern = 1
  566.     # The number of frames needed is the distance between current position and
  567.     # target position.
  568.     pos_x = @battler.target_x - self.x
  569.     pos_y = @battler.target_y - self.y
  570.     # Caculation for ammount of frames needed.
  571.     @direct_move_cnt = @direct_attack_cnt = (pos_x.abs / SideView::MOTION_SPEED).round
  572.     # NEXT Phase
  573.     @direct_attack_phase += 1
  574.   end
  575.   #--------------------------------------------------------------------------
  576.   # ● Proximity Attack Execution [Move Operation (Going)]
  577.   #--------------------------------------------------------------------------
  578.   def diratk_move
  579.     case @battler
  580.     when Game_Actor
  581.       x_plus = @width
  582.       y_plus = -@height / 4
  583.     when Game_Enemy
  584.       x_plus = -@width - 10
  585.       y_plus = @height / 4
  586.     end
  587.     # The next movement location is figured out by the distance between
  588.     # current position and target position.
  589.     pos_x = @battler.target_x - self.x + x_plus
  590.     pos_y = @battler.target_y - self.y + y_plus
  591.     @battler_x_plus += pos_x / @direct_attack_cnt if @direct_attack_cnt != 0
  592.     @battler_y_plus += pos_y / @direct_attack_cnt if @direct_attack_cnt != 0
  593.     # End count
  594.     @direct_attack_cnt -= 1
  595.     # Last movement (Insurance: Last correction)
  596.     if @direct_attack_cnt <= 0
  597.       @battler_x_plus = @battler.target_x - @battler.screen_x + x_plus
  598.       @battler_y_plus = @battler.target_y - @battler.screen_y + y_plus
  599.       # NEXTフェーズ
  600.       @direct_attack_cnt = 5
  601.       @direct_attack_phase += 1
  602.     end
  603.   end
  604.   #--------------------------------------------------------------------------
  605.   # ● Proximity Attack Execution [Attack Operation Return]
  606.   #--------------------------------------------------------------------------
  607.   def diratk_wait
  608.     # End Count
  609.     @direct_attack_cnt -= 1
  610.     # Last Movement
  611.     if @direct_attack_cnt <= 0
  612.       # Pose Change
  613.       @pattern = 3
  614.       # END Phase
  615.       @direct_attack_phase = 0
  616.       @battler.motion_stop = false
  617.     end
  618.   end
  619.   #--------------------------------------------------------------------------
  620.   # ● Proximity Attack Execution [Attack Operation Return]
  621.   #--------------------------------------------------------------------------
  622.   def diratk_attack
  623.     # Pose Change
  624.     @pattern = 1
  625.     # End Wait Count
  626.     @direct_attack_cnt = @direct_move_cnt
  627.     # NEXT Phase
  628.     @direct_attack_phase += 1
  629.   end
  630.   #--------------------------------------------------------------------------
  631.   # ● Proximity Attack Execution [Move Operation (Return)]
  632.   #--------------------------------------------------------------------------
  633.   def diratk_back
  634.     # The next movement location is figured out by the distance between
  635.     # current position and target position.
  636.     pos_x = @battler.screen_x - self.x
  637.     pos_y = @battler.screen_y - self.y
  638.     @battler_x_plus += pos_x / @direct_attack_cnt if @direct_attack_cnt != 0
  639.     @battler_y_plus += pos_y / @direct_attack_cnt if @direct_attack_cnt != 0
  640.     # End Count
  641.     @direct_attack_cnt -= 1
  642.     # Last Movement
  643.     if @direct_attack_cnt == 0
  644.       @battler_x_plus = 0
  645.       @battler_y_plus = 0
  646.       # NEXT Phase
  647.       @direct_attack_phase += 1
  648.     end
  649.   end
  650.   #--------------------------------------------------------------------------
  651.   # ● Proximity attack execution [Operation End]
  652.   #--------------------------------------------------------------------------
  653.   def diratk_end
  654.     init_direct_attack
  655.     @battler.motion_stop = false
  656.     # END Phase
  657.     @direct_attack_phase = 0
  658.   end
  659. end
复制代码

《天空之城 —— 破碎的命运》
回复 支持 反对

使用道具 举报

头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
0 小时
注册时间
2006-4-23
帖子
53
8
 楼主| 发表于 2008-6-1 19:04:19 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
回复 支持 反对

使用道具 举报

Lv2.观梦者

神隐的主犯

梦石
0
星屑
283
在线时间
271 小时
注册时间
2008-2-22
帖子
7691

贵宾

9
发表于 2008-6-1 19:05:34 | 只看该作者
那么,请使用FUKI对话框脚本吗,很华丽的说。

精简版: http://rpg.blue/web/htm/news663.htm

http://rpg.blue/web/htm/news726.htm

《天空之城 —— 破碎的命运》
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

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

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

GMT+8, 2024-11-16 07:30

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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