赞 | 1 |
VIP | 38 |
好人卡 | 7 |
积分 | 3 |
经验 | 52355 |
最后登录 | 2024-11-17 |
在线时间 | 853 小时 |
Lv2.观梦者
- 梦石
- 0
- 星屑
- 305
- 在线时间
- 853 小时
- 注册时间
- 2014-5-5
- 帖子
- 948
|
我这有个,你试试
战斗图要做成像下面这样的
另附脚本
(原脚本的注释都是英文,我用百度翻译的,有点奇怪)- #==============================================================================
- # 本脚本来自www.66RPG.com,使用和转载请保留此信息
- #==============================================================================
- #==============================================================================
- # * Animated_Sprite Scripted by: SiR_VaIlHoR
- # Edited by: 柳柳
- #------------------------------------------------------------------------------
- # A class for animated sprites.
- #==============================================================================
- #66RPG,超级横版战斗脚本简要说明:
- #默认情况下,把一张战斗图截成4列,>8行,如果感觉4列4帧的动画还不能满足要求,看
- #def pose(number,frame = 4),更改=4,以及相关部分。
-
- #战斗图从上到下:前进图,等待图,防御图,挨打图,普通攻击图(默认的武器),施展魔法,
- #倒地不行了,胜利姿势,自定义武器1,自定义武器2……
- #这个脚本的模型是老外编写的,其中参考了XMXS的一个方法,我添加了一些功能,去掉素材限制。
- #不同职业拥有的图片数可以不一样,参考工程和录像教学
- #==============================================================================
- # □ RPG::Class
- #==============================================================================
- module RPG
- class Class
- def name
- name = @name.split(/,/)[0]
- return name != nil ? name : ''
- end
- def name2
- name = @name.split(/,/)[1]
- return name != nil ? name : ''
- end
- end
- class Weapon
- def name
- name = @name.split(/,/)[0]
- return name != nil ? name : ''
- end
- def name2
- name = @name.split(/,/)[1]
- return name != nil ? name : ''
- end
- end
- end
- class Game_Actor
- #--------------------------------------------------------------------------
- # ● 更改名称
- # name : 新的名称
- #--------------------------------------------------------------------------
- def picturephase
- name = $data_classes[class_id].name2
- return name != nil ? name : "66RPG"
- end
- end
- class Game_Enemy
- #--------------------------------------------------------------------------
- # ● 获取名称
- #--------------------------------------------------------------------------
- def name
- name = $data_enemies[@enemy_id].name.split(/,/)[0]
- return name != nil ? name : ''
- end
- def picturephase
- name = $data_enemies[@enemy_id].name.split(/,/)[1]
- return name != nil ? name : "66RPG"
- end
- end
- class Animated_Sprite < RPG::Sprite
- #--------------------------------------------------------------------------
- #可访问的实例变量。
- #--------------------------------------------------------------------------
- attr_accessor :frames #动画的帧的数目
- attr_accessor :delay # 帧间延迟时间(速度)
- attr_accessor :frame_width # 每一帧的宽度
- attr_accessor :frame_height # 每一帧的高度
- attr_accessor :offset_x # 在第一帧的X坐标
- attr_accessor :offset_y # Y的所有帧的坐标
- attr_accessor :current_frame # 当前的动画帧
- attr_accessor :moving # 是精灵移动?
- #--------------------------------------------------------------------------
- # - Initialize an animated sprite
- # viewport : Sprite viewport
- #--------------------------------------------------------------------------
- def initialize(viewport = nil)
- super(viewport)
- @frame_width, @frame_height = 0, 0
- change # 一个基本的变化来设置初始变量
- @old = Graphics.frame_count # 对于延迟的方法
- @goingup = true # 增加动画?(if @rm2k_mode is true)
- @once = false # 是动画只播放一次?
- @animated = true # 用于停止动画的时候”曾经是真实的
- end
- #--------------------------------------------------------------------------
- # RPG的评论
- #变化源矩形(改变动画)
- #帧:动画的帧的数目
- #延迟:帧延迟,控制动画速度
- # offx:在第一帧的X坐标
- #抉择:Y所有帧的坐标
- # STARTF:动画起始帧
- #一旦:是动画只播放一次?
- # rm2k_mode:动画模式:1-2-3-2如果属实,1-2-3-1假
- #
- #评论cybersam
- #
- #的rm2k_mode不是礼物了…
- #如果你想的话,#特征然后用rm2k或使用RPG的SCRîPT…
- #--------------------------------------------------------------------------
- def change(frames = 0, delay = 0, offx = 0, offy = 0,
- startf = 0, once = false)
- @frames = frames
- @delay = delay
- @offset_x, @offset_y = offx, offy
- @current_frame = startf
- @once = once
- x = @current_frame * @frame_width + @offset_x
- self.src_rect = Rect.new(x, @offset_y, @frame_width, @frame_height)
- @goingup = true
- @animated = true
- end
-
- #--------------------------------------------------------------------------
- # 更新动画和运动
- #--------------------------------------------------------------------------
- def update
- super
- if self.bitmap != nil and delay(@delay) and @animated
- x = @current_frame * @frame_width + @offset_x
- self.src_rect = Rect.new(x, @offset_y, @frame_width, @frame_height)
- @current_frame = (@current_frame + 1) unless @frames == 0
- @animated = false if @current_frame == @frames and @once
- @current_frame %= @frames
- end
- end
-
- #--------------------------------------------------------------------------
- # -移动精灵
- # X:对目标点的X坐标
- # Y Y的目标点的坐标
- #速度:运动速度(0 =延迟,1 + =更快)
- #延迟:如果速度是0延迟运动
- #--------------------------------------------------------------------------
- def move(x, y, speed = 1, delay = 0)
- @destx = x
- @desty = y
- @move_speed = speed
- @move_delay = delay
- @move_old = Graphics.frame_count
- @moving = true
- end
-
- #--------------------------------------------------------------------------
- #移动精灵destx和类
- #--------------------------------------------------------------------------
- def update_move
- return unless @moving
- movinc = @move_speed == 0 ? 1 : @move_speed
- if Graphics.frame_count - @move_old > @move_delay or @move_speed != 0
- self.x += movinc if self.x < @destx
- self.x -= movinc if self.x > @destx
- self.y += movinc if self.y < @desty
- self.y -= movinc if self.y > @desty
- @move_old = Graphics.frame_count
- end
- if @move_speed > 1 # 检查如果精灵无法做到这一点
- self.x = @destx if (@destx - self.x).abs % @move_speed != 0 and
- (@destx - self.x).abs <= @move_speed
- self.y = @desty if (@desty - self.y).abs % @move_speed != 0 and
- (@desty - self.y).abs <= @move_speed
- end
- if self.x == @destx and self.y == @desty
- @moving = false
- end
- end
-
- #--------------------------------------------------------------------------
- #暂停动画,但还是更新运动
- #帧:帧的数目
- #--------------------------------------------------------------------------
- def delay(frames)
- update_move
- if (Graphics.frame_count - @old >= frames)
- @old = Graphics.frame_count
- return true
- end
- return false
- end
- end
- #=============================================================================
- #
- #在这里,我们走…
- #这使得SCRîPT很容易实现
- #只需添加一个新的SCRîPT上面的“主要”SCRîPT
- #并将这整件事在那里
- #
- #你可以看到精灵改变代码是从日本SCRîPT
- #所以妖怪变的学分去他们…
- #我编辑这一点,它可以显示更多的精灵和精灵动画
- #和增加了一些其他的东西…接下来的事情是球员的运动…
- #
- #
- #
- #我也是变化的îPt在这î可控硅SCR催化剂…
- #学分这是谁做的这个家伙…
- #
- #▼▲▼xrxs11。0▼▲▼戦闘・バトラーモーション版本。
- #
- #因为这不是用了…它不需要信用卡了…
- #但我会让它在这里因为它帮了我很多…
- #
- #
- #为理念…小姐为我提供了很好的思路
- #,帮了我很多,我没找到一种方法,其中的一些功能…
- #
- #这里更多的信贷来的地方…
- #的RPG的SCRîPT…
- #这里不是整个事情…
- #但有些snipplet你知道女巫时,阅读评论
- #
- #
- #如果你想要# SCRîPT了更多一些…
- #最多的东西是评论…但如果你仍然有问题或
- #建议的话可以联系我
- #
- #如何或在哪里可以联系我…
- #在通过时,电子邮件的http://www.rmxp.net论坛:[email protected]
- #目的:通过#或cych4n或ICQ:73130840
- #
- #记住这是仍在测试阶段…
- #和我要工作在一些其他的添加剂…喜欢的人物动作…
- #但不会加入我们…因为我需要先弄清楚…
- #
- #
- #
- #哦呵呵…在我忘记之前…
- #抱歉为坏的英文…^ - ^ ''''
- #
- #
- #==============================================================================
- #
- #在这里我要告诉你,你需要给你的甜心什么名字
- #战斗的精灵的…
- #
- #好…在这里…因为我使用RPG的运动îPt晶闸管…
- #有很多变化…
- #
- #当你看# SCRîPT你会找到符合的姿势(N)”或“enemy_pose(N)”
- #因为我想我#精灵有不同的精灵…我还添加了一个选项
- #这些…
- #现在如果你#后添加一个数N(N为女巫精灵使用)
- #如8…(“姿势(4,8)”)这将告诉SCRîPT,第四动画
- #有8帧…
- #构成用于球员…和敌人enemy_pose…
- #没有比这更多的…
- #我用我的老精灵数量#…(这一次只有一个精灵……)
- #
- #说明动画精灵…(数字)
- #
- #
- # 0 =移动(在战争中)
- # 1 =备用
- # 2 =辩护
- # 3 =打(攻击)
- # 4 =攻击
- # 5 =使用技能
- # 6 =死亡
- # 7 =胜利的姿势…这个想法是从RPG的…
- #
- #
- #当然这只是代码的开始…
- #所以更多的动画可以实现…
- #但现在这应该是足够的…
- #
- #很多已经改变了这里…现在看起来做的…
- #当然好编辑需要做,所以它看起来和伟大的作品你
- #游戏…
- #
- #
- #
- #第一字符的运动…完成
- #第二字运动中攻击…完成
- #第三字符出现在敌人攻击时…完成
- #
- #第四敌人运动…完成
- #第五运动中攻击敌人…完成
- #第六敌人似乎在敌人攻击时…完成
- #
- #第七每个武器都有自己的动画…完成
- #第八每个技能都有它自己的动画…完成
- #
- #
- #
- #的interisted…我的新项目是一个电影播放器
- #(这实际上起到AVI,指导价格等…
- #却不认为这会很快结束…^ - ^”
- #
- #但我可以试试别的我开始之前的代码,一个…
- #==============================================================================
-
- class Game_Actor < Game_Battler
-
- #你没有改变你的游戏的演员,让人物schows
- #从侧面…
- #这会为你做的…^ - ^
- def screen_x
- if self.index != nil
- return self.index * 30+ 375
- else
- return 0
- end
- end
- def screen_y
- return self.index * 45 + 175
- end
-
- def screen_z
- if self.index != nil
- return self.index
- else
- return 0
- end
- end
- end
- # RPG's snipplet...
- class Spriteset_Battle
- attr_accessor :actor_sprites
- attr_accessor :enemy_sprites
-
-
- alias original_initialize initialize
- def initialize
- # _派对@启动游戏_ party.actors.size _ number=元
- #ビューポートを作成
- @viewport0 = Viewport.new(0, 0, 640, 480)
- @viewport1 = Viewport.new(0, 0, 640, 320)
- @viewport2 = Viewport.new(0, 0, 640, 480)
- @viewport3 = Viewport.new(0, 0, 640, 480)
- @viewport4 = Viewport.new(0, 0, 640, 480)
- @viewport1.z = 50
- @viewport2.z = 50
- @viewport3.z = 200
- @viewport4.z = 5000
- @battleback_sprite = Sprite.new(@viewport0)
-
- @enemy_sprites = []
- for enemy in $game_troop.enemies #.reverse
- @enemy_sprites.push(Sprite_Battler.new(@viewport1, enemy))
- end
-
- @actor_sprites = []
- @actor_sprites.push(Sprite_Battler.new(@viewport2,$game_party.actors[0]))
- @actor_sprites.push(Sprite_Battler.new(@viewport2,$game_party.actors[1]))
- @actor_sprites.push(Sprite_Battler.new(@viewport2,$game_party.actors[2]))
- @actor_sprites.push(Sprite_Battler.new(@viewport2,$game_party.actors[3]))
-
- @weather = RPG::Weather.new(@viewport1)
- @picture_sprites = []
- for i in 51..100
- @picture_sprites.push(Sprite_Picture.new(@viewport3,
- $game_screen.pictures[i]))
- end
- @timer_sprite = Sprite_Timer.new
- update
- end
-
-
-
- alias original_update update
- def update
- @viewport1.z = 50 and @viewport2.z = 51 if $actor_on_top == true
- @viewport1.z = 51 and @viewport2.z = 50 if $actor_on_top == false
- # 刷新角色的活动块 (对应角色的替换)
- @actor_sprites[0].battler = $game_party.actors[0]
- @actor_sprites[1].battler = $game_party.actors[1]
- @actor_sprites[2].battler = $game_party.actors[2]
- @actor_sprites[3].battler = $game_party.actors[3]
- # 战斗背景的文件名与现在情况有差异的情况下
- if @battleback_name != $game_temp.battleback_name
- @battleback_name = $game_temp.battleback_name
- if @battleback_sprite.bitmap != nil
- @battleback_sprite.bitmap.dispose
- end
- @battleback_sprite.bitmap = RPG::Cache.battleback(@battleback_name)
- @battleback_sprite.src_rect.set(0, 0, 640, 480)
- end
- # 刷新战斗者的活动块
- for sprite in @enemy_sprites + @actor_sprites
- sprite.update
- end
- # 刷新天气图形
- @weather.type = $game_screen.weather_type
- @weather.max = $game_screen.weather_max
- @weather.update
- # 刷新图片活动块
- for sprite in @picture_sprites
- sprite.update
- end
- # 刷新计时器活动块
- @timer_sprite.update
- # 设置画面的色调与震动位置
- @viewport1.tone = $game_screen.tone
- @viewport1.ox = $game_screen.shake
- # 设置画面的闪烁色
- @viewport4.color = $game_screen.flash_color
- # 刷新显示端口
- @viewport1.update
- @viewport2.update
- @viewport4.update
- end
- end
- # end
- # ==============================================================================
- #精灵战士的服装战斗系统
- # ==============================================================================
- #我们做一些动画和东西…
- #我知道这不是最好的办法…
- #但这是第一次的工作方式,我找到了…
- #这需要正确理解动画作品…
- #如果你想改变一些东西…
- #在这我没有解释太多因为它真的容易,如果你知道你在做什么
- #否则将采取你的时间去了解它,但我想的人
- #试图编辑本就知道他/她做…^ - ^
- #
- #
- #
- #这里我会完全取代“sprite_battler”类…
- #所以如果你已经改变了一些东西在那里你需要改变它在这里就好了
- #(我认为…我没有测试它…所以你了)
- #我标记我只增加——> #
- #什么需要说明的有一个评论…
- #但并不是所有的评论#…
- #所以如果你不知道这意味着什么,或者你只是想知道为什么它是存在的,
- #它做什么,那么你需要联系我或任何人谁明白…^ - ^
- #如何你可以联系我看到上面…在这个SCRîPt的顶部…
- class Sprite_Battler < Animated_Sprite
- attr_accessor :battler
- attr_reader :index
- attr_accessor :target_index
- attr_accessor :frame_width
- def initialize(viewport, battler = nil)
- super(viewport)
- @battler = battler
- @pattern_b = 0 #
- @counter_b = 0 #
- @index = 0 #
- if @battler != nil
- tempbitmap = RPG::Cache.battler(@battler.battler_name, @battler.battler_hue)
- @frame_width = tempbitmap.width/4
- picturephase = @battler.picturephase
- if picturephase == "66RPG"
- @frame_height = tempbitmap.height/8
- else
- @frame_height = tempbitmap.height/8
- end
- else
- @frame_width, @frame_height = 1,1
- end
- # start sprite
- @battler.is_a?(Game_Enemy) ? enemy_pose(1) : pose(1)
- @battler_visible = false
- if $target_index == nil
- $target_index = 0
- end
- end
-
- def index=(index) #
- @index = index #
- update #
- end #
-
- def dispose
- if self.bitmap != nil
- self.bitmap.dispose
- end
- super
- end
-
- def enemy #
- $target_index += $game_troop.enemies.size
- $target_index %= $game_troop.enemies.size
- return $game_troop.enemies[$target_index] #
- end #
-
- def actor #
- $target_index += $game_party.actors.size
- $target_index %= $game_party.actors.size
- return $game_party.actors[$target_index] #
- end
- #==============================================================================
- #这里是RPG的SCRîPT snipplet…
- #我只改变线从这…
- #
- #这里你可以添加更多的精灵了…如果你有更多的…^ - ^
- #==============================================================================
- def pose(number, frames = 4)
- case number
- when 0 # run
- change(frames, 5, 0, 0, 0)
- when 1 # standby
- change(frames, 5, 0, @frame_height)
- when 2 # defend
- change(frames, 5, 0, @frame_height * 2)
- when 3 # Hurt, loops
- change(frames, 5, 0, @frame_height * 3)
- when 4 # attack no loop
- change(frames, 5, 0, @frame_height * 4, 0, true)
- when 5 # skill
- change(frames, 5, 0, @frame_height * 5)
- when 6 # death
- change(frames, 5, 0, @frame_height * 6)
- when 7 # winning pose
- change(frames, 5, 0, @frame_height * 7)
- when 8 # no sprite
- change(frames, 5, 0, @frame_height * 8)
- when 9 # no sprite
- change(frames, 5, 0, @frame_height * 9)
- when 10 # no sprite
- change(frames, 5, 0, @frame_height * 10)
- when 11 # no sprite
- change(frames, 5, 0, @frame_height * 11)
- when 12 # no sprite
- change(frames, 5, 0, @frame_height * 12)
- when 13 # no sprite
- change(frames, 5, 0, @frame_height * 13)
- when 14 # no sprite
- change(frames, 5, 0, @frame_height * 14)
- when 15 # no sprite
- change(frames, 5, 0, @frame_height * 15)
- when 16 # no sprite
- change(frames, 5, 0, @frame_height * 16)
- when 17 # no sprite
- change(frames, 5, 0, @frame_height * 17)
- when 18 # no sprite
- change(frames, 5, 0, @frame_height * 18)
- when 19 # no sprite
- change(frames, 5, 0, @frame_height * 19)
- when 20 # no sprite
- change(frames, 5, 0, @frame_height * 20)
- # ...etc.
- else
- change(frames, 5, 0, @frame_height * number, 0)
- end
- end
-
- #--------------------------------------------------------------------------
- #变化的敌人的战斗姿态
- #号:姿势数
- #--------------------------------------------------------------------------
- def enemy_pose(number ,enemy_frames = 4)
- case number
- when 0 # run
- change(enemy_frames, 5, 0, 0, 0)
- when 1 # standby
- change(enemy_frames, 5, 0, @frame_height)
- when 2 # defend
- change(enemy_frames, 5, 0, @frame_height * 2)
- when 3 # Hurt, loops
- change(enemy_frames, 5, 0, @frame_height * 3)
- when 4 # attack
- change(enemy_frames, 5, 0, @frame_height * 4, 0, true)
- when 5 # skill
- change(enemy_frames, 5, 0, @frame_height * 5)
- when 6 # death
- change(enemy_frames, 5, 0, @frame_height * 6)
- when 7 # no sprite
- change(enemy_frames, 5, 0, @frame_height * 7)
- # ...etc.
- else
- change(enemy_frames, 5, 0, @frame_height * number, 0)
- end
- end
- #==============================================================================
- # sniplet end...
- #==============================================================================
-
-
- def update
- super
-
- if @battler == nil
- self.bitmap = nil
- loop_animation(nil)
- return
- end
- if @battler.battler_name != @battler_name or
- @battler.battler_hue != @battler_hue
- @battler_name = @battler.battler_name
- @battler_hue = @battler.battler_hue
- self.bitmap = RPG::Cache.battler(@battler_name, @battler_hue)
- @width = bitmap.width
- @height = bitmap.height
- self.ox = @frame_width / 2
- self.oy = @frame_height
- if @battler.dead? or @battler.hidden
- self.opacity = 0
- end
- self.x = @battler.screen_x
- self.y = @battler.screen_y
- self.z = @battler.screen_z
- end
- if @battler.damage == nil and
- @battler.state_animation_id != @state_animation_id
- @state_animation_id = @battler.state_animation_id
- loop_animation($data_animations[@state_animation_id])
- end
- if @battler.is_a?(Game_Actor) and @battler_visible
- if $game_temp.battle_main_phase
- self.opacity += 3 if self.opacity < 255
- else
- self.opacity -= 3 if self.opacity > 207
- end
- end
- if @battler.blink
- blink_on
- else
- blink_off
- end
- unless @battler_visible
- if not @battler.hidden and not @battler.dead? and
- (@battler.damage == nil or @battler.damage_pop)
- appear
- @battler_visible = true
- end
- if not @battler.hidden and
- (@battler.damage == nil or @battler.damage_pop) and
- @battler.is_a?(Game_Actor)
- appear
- @battler_visible = true
- end
- end
- if @battler_visible
- if @battler.hidden
- $game_system.se_play($data_system.escape_se)
- escape
- @battler_visible = false
- end
- if @battler.white_flash
- whiten
- @battler.white_flash = false
- end
- if @battler.animation_id != 0
- animation = $data_animations[@battler.animation_id]
- animation(animation, @battler.animation_hit)
- @battler.animation_id = 0
- end
- if @battler.damage_pop
- damage(@battler.damage, @battler.critical)
- @battler.damage = nil
- @battler.critical = false
- @battler.damage_pop = false
- end
- if @battler.damage == nil and @battler.dead?
- if @battler.is_a?(Game_Enemy)
- $game_system.se_play($data_system.enemy_collapse_se)
- collapse
- @battler_visible = false
- else
- $game_system.se_play($data_system.actor_collapse_se) unless @dead
- @dead = true
- pose(6)
- end
- else
- @dead = false
- end
- end #
- end
- end
- #==============================================================================
- # Scene_Battle Costum Battle System
- #==============================================================================
- class Scene_Battle
-
-
- def update_phase4
- case @phase4_step
- when 1
- update_phase4_step1
- when 2
- update_phase4_step2
- when 3
- update_phase4_step3
- when 4
- update_phase4_step4
- when 5
- update_phase4_step5
- when 6
- update_phase4_step6
- when 7
- update_phase4_step7
- when 8
- update_phase4_step8
- end
- end
-
-
- def make_basic_action_result
-
- if @active_battler.is_a?(Game_Actor)
- $actor_on_top = true
- elsif @active_battler.is_a?(Game_Enemy)
- $actor_on_top = false
- end
-
- if @active_battler.current_action.basic == 0
- # ============================================================================
- #武器开始…
- # ============================================================================
- #
- # =================================不同武器不同的动画
- #
- #正如你可以看到,这是相当简单的#…
- #如果你想添加一个武器动画列表然后看下面的SCRîPT…
- #,我希望你会发现这是如何工作的…
- #
- #
- #如果不#…
- #这里是这样的…
- #第一件事…
- #只是复制和粘贴”的“@active_battler_enemy.weapon_id = =一致。”
- #只是在最后的“weapon_sprite的…
- #
- #这里的ID是你需要看看你的游戏数据库的数量,站在
- #你的武器的名字是你需要在这里输入的ID…
- #
- #也是一样的怪物的方…^ - ^
- #怪物通常不需要武器…更多的精灵
- #
- #如果你想使用更多#…然后替换“@ weapon_sprite_enemy = 4”
- #这些线…(但是你需要编辑)
- #
- #如果@active_battler.weapon_id = = 1 # <——武器的ID号
- # @ weapon_sprite_enemy = 4 # <——战斗动画
- # elsif @active_battler.weapon_id = = 5 # <——武器的ID号
- # @ weapon_sprite_enemy = 2 # <——战斗动画
- # elsif @active_battler.weapon_id = = 9 # <——武器的ID号
- # @ weapon_sprite_enemy = 0 # <——战斗动画
- # elsif @active_battler.weapon_id = = 13 # <——武器的ID号
- # @ weapon_sprite_enemy = 6 # <——战斗动画
- #其他#
- # @ weapon_sprite_enemy = 4
- #结束
- #
- # =================================结束
- if @active_battler.is_a?(Game_Actor)
- if $data_weapons[@active_battler.weapon_id] == nil
- @weapon_sprite = 4
- else
- if $data_weapons[@active_battler.weapon_id].name2 == nil or
- $data_weapons[@active_battler.weapon_id].name2 == ""
- @weapon_sprite = 4
- else
- @weapon_sprite = $data_weapons[@active_battler.weapon_id].name2.to_i
- end
- end
-
- #怪物部分在这里…^ - ^
- else # @active_battler.is_a?(Game_Enemy)
- @weapon_sprite_enemy = 4
- end
-
- #
- #=============================================================================
- # WEAPONS END....
- #=============================================================================
-
-
- @animation1_id = @active_battler.animation1_id
- @animation2_id = @active_battler.animation2_id
- if @active_battler.is_a?(Game_Enemy)
- if @active_battler.restriction == 3
- target = $game_troop.random_target_enemy
- elsif @active_battler.restriction == 2
- target = $game_party.random_target_actor
- else
- index = @active_battler.current_action.target_index
- target = $game_party.smooth_target_actor(index)
- end
- #======== 这里是运动和动画的设置…
- x = target.screen_x - RPG::Cache.battler(@active_battler.battler_name, @active_battler.battler_hue).width/6
- @spriteset.enemy_sprites[@active_battler.index].enemy_pose(0)
- @spriteset.enemy_sprites[@active_battler.index].move(x, target.screen_y, 10)
- # =========在这里,如果你看看RPG的运动设置,你会看到
- # =========,他以40为动画的速度…
- # =========我东西太快所以我制定了10所以看起来平滑...
- end
- if @active_battler.is_a?(Game_Actor)
- if @active_battler.restriction == 3
- target = $game_party.random_target_actor
- elsif @active_battler.restriction == 2
- target = $game_troop.random_target_enemy
- else
- index = @active_battler.current_action.target_index
- target = $game_troop.smooth_target_enemy(index)
- end
- #======= 对于球员同样的事情…^ - ^
- x = target.screen_x + RPG::Cache.battler(@active_battler.battler_name, @active_battler.battler_hue).width/8
- @spriteset.actor_sprites[@active_battler.index].pose(0)
- @spriteset.actor_sprites[@active_battler.index].move(x, target.screen_y, 10)
- end
- @target_battlers = [target]
- for target in @target_battlers
- target.attack_effect(@active_battler)
- end
- return
- end
- if @active_battler.current_action.basic == 1
- if @active_battler.is_a?(Game_Actor)
- @spriteset.actor_sprites[@active_battler.index].pose(2) #防御
- else
- @spriteset.enemy_sprites[@active_battler.index].enemy_pose(2) #defence
- end
- @help_window.set_text($data_system.words.guard, 1)
- return
- end
- if @active_battler.is_a?(Game_Enemy) and
- @active_battler.current_action.basic == 2
- @help_window.set_text("逃走", 1)
- @active_battler.escape
- return
- end
- if @active_battler.current_action.basic == 3
- $game_temp.forcing_battler = nil
- @phase4_step = 1
- return
- end
-
- if @active_battler.current_action.basic == 4
- if $game_temp.battle_can_escape == false
- $game_system.se_play($data_system.buzzer_se)
- return
- end
- $game_system.se_play($data_system.decision_se)
- update_phase2_escape
- return
- end
- end
- #--------------------------------------------------------------------------
- # skill aktion...
- #--------------------------------------------------------------------------
- def make_skill_action_result
- @skill = $data_skills[@active_battler.current_action.skill_id]
- unless @active_battler.current_action.forcing
- unless @active_battler.skill_can_use?(@skill.id)
- $game_temp.forcing_battler = nil
- @phase4_step = 1
- return
- end
- end
- @active_battler.sp -= @skill.sp_cost
- @status_window.refresh
- @help_window.set_text(@skill.name, 1)
-
- # =============================================================================
- #技能的精灵开始
- # =============================================================================
- #这是为武器一样…
- #为人本的第一次
- #看SCRîPT我希望它是很容易理解的…
- #
- #另一个有早期版本的这个SCRîPT他们不需要explenation
- #…我认为…
- #认为改变是线在动画ID给精灵…
- #数后的“姿态”是动画的一致。它为每一个其他的动画以及..
- #如果你有技能,有更多的帧动画…
- #然后插入帧的数量后第一个数字…
- #看来这个…”姿势(5,8)“<<——5是动画…
- # 8是最大帧(这意味着你的动画有8帧……)^ - ^
-
- if @active_battler.is_a?(Game_Actor)
- if @skill.name != "one of the skills" # <--skill doesn't exist => all the skills have the skill animation!
- @spriteset.actor_sprites[@active_battler.index].pose(5) # <-- sprite number
- end
- else
- if @skill.name != "one of the skills" # <-- first skill name
- @spriteset.enemy_sprites[@active_battler.index].enemy_pose(5) # <-- sprite number
- end
- end
- #=============================================================================
- # SKILL SPRITES END
- #=============================================================================
-
- @animation1_id = @skill.animation1_id
- @animation2_id = @skill.animation2_id
- @common_event_id = @skill.common_event_id
- set_target_battlers(@skill.scope)
- for target in @target_battlers
- target.skill_effect(@active_battler, @skill)
- end
- end
- #--------------------------------------------------------------------------
- #在这里,我们如何使项目使用aktions
- #--------------------------------------------------------------------------
- def make_item_action_result
- #对不起我没这方面的工作…
- #因为我没有一个精灵,使用物品的…
- #所以我刚刚添加的备用的精灵在这里…
- #当我得到这个#更多的时间我会尽我所能做的这一个…^ - ^
- #其同上面的…
- if @active_battler.is_a?(Game_Actor)
- @spriteset.actor_sprites[@active_battler.index].pose(1)
- else
- @spriteset.enemy_sprites[@active_battler.index].enemy_pose(1)
- end
-
- @item = $data_items[@active_battler.current_action.item_id]
- unless $game_party.item_can_use?(@item.id)
- @phase4_step = 1
- return
- end
- if @item.consumable
- $game_party.lose_item(@item.id, 1)
- end
- @help_window.set_text(@item.name, 1)
- @animation1_id = @item.animation1_id
- @animation2_id = @item.animation2_id
- @common_event_id = @item.common_event_id
- index = @active_battler.current_action.target_index
- target = $game_party.smooth_target_actor(index)
- set_target_battlers(@item.scope)
- for target in @target_battlers
- target.item_effect(@item)
- end
- end
-
- # ==============================================================================
- #这里了…从RPG的SCRîPT snipplet
- # ==============================================================================
- #这是胜利的姿势…
- #如果你使用我的老习惯水平SCRî接着你需要增加
- #标记线给你“def start_phase5”中的“scene_battle 2”和删除这一…
- # - > = ***** =
- #结束标志,你需要删除…
- #和-> ===== } {
- #标志,你需要复制和粘贴在另一条线…
- #你需要添加在同一位置…
- def start_phase5
- @phase = 5
- $game_system.me_play($game_system.battle_end_me)
- $game_system.bgm_play($game_temp.map_bgm)
- exp = 0
- gold = 0
- treasures = []
- for enemy in $game_troop.enemies
- unless enemy.hidden
- exp += enemy.exp
- gold += enemy.gold
- if rand(100) < enemy.treasure_prob
- if enemy.item_id > 0
- treasures.push($data_items[enemy.item_id])
- end
- if enemy.weapon_id > 0
- treasures.push($data_weapons[enemy.weapon_id])
- end
- if enemy.armor_id > 0
- treasures.push($data_armors[enemy.armor_id])
- end
- end
- end
- end
- treasures = treasures[0..5]
- for i in 0...$game_party.actors.size
- actor = $game_party.actors[i]
- @spriteset.actor_sprites[i].pose(7) unless actor.dead? # {=====}
- if actor.cant_get_exp? == false
- last_level = actor.level
- actor.exp += exp
- if actor.level > last_level
- @status_window.level_up(i)
- end
- end
- end
- $game_party.gain_gold(gold)
- for item in treasures
- case item
- when RPG::Item
- $game_party.gain_item(item.id, 1)
- when RPG::Weapon
- $game_party.gain_weapon(item.id, 1)
- when RPG::Armor
- $game_party.gain_armor(item.id, 1)
- end
- end
- @result_window = Window_BattleResult.new(exp, gold, treasures)
- @phase5_wait_count = 100
- end
- # =*****=
- #--------------------------------------------------------------------------
- #更新运动
- #由于RPG不是用来评论…我要评论它再次…
- #--------------------------------------------------------------------------
- def update_phase4_step3
- if @active_battler.current_action.kind == 0 and
- @active_battler.current_action.basic == 0
- # 在这一个…我们有我们的武器动画…玩家和怪物
- if @active_battler.is_a?(Game_Actor)
- @spriteset.actor_sprites[@active_battler.index].pose(@weapon_sprite)
- elsif @active_battler.is_a?(Game_Enemy)
- @spriteset.enemy_sprites[@active_battler.index].enemy_pose(@weapon_sprite_enemy)
- end
- end
- if @animation1_id == 0
- @active_battler.white_flash = true
- else
- @active_battler.animation_id = @animation1_id
- @active_battler.animation_hit = true
- end
- @phase4_step = 4
- end
- def update_phase4_step4
- # 这是热播的动画…
- for target in @target_battlers
- if target.is_a?(Game_Actor) and !@active_battler.is_a?(Game_Actor)
- if target.guarding?
- @spriteset.actor_sprites[target.index].pose(2)
- else
- @spriteset.actor_sprites[target.index].pose(3)
- end
- elsif target.is_a?(Game_Enemy) and !@active_battler.is_a?(Game_Enemy)
- if target.guarding?
- @spriteset.enemy_sprites[target.index].enemy_pose(2)
- else
- @spriteset.enemy_sprites[target.index].enemy_pose(3)
- end
- end
- target.animation_id = @animation2_id
- target.animation_hit = (target.damage != "Miss")
- end
- @wait_count = 8
- @phase4_step = 5
- end
- def update_phase4_step5
- if @active_battler.hp > 0 and @active_battler.slip_damage?
- @active_battler.slip_damage_effect
- @active_battler.damage_pop = true
- end
- @help_window.visible = false
- @status_window.refresh
- #这里是后卫动画…
- if @active_battler.is_a?(Game_Actor)
- @spriteset.actor_sprites[@active_battler.index].pose(1)
- else
- @spriteset.enemy_sprites[@active_battler.index].enemy_pose(1)
- end
- for target in @target_battlers
- if target.damage != nil
- target.damage_pop = true
- if @active_battler.is_a?(Game_Actor)
- @spriteset.actor_sprites[@active_battler.index].pose(1)
- else
- @spriteset.enemy_sprites[@active_battler.index].enemy_pose(1)
- end
- end
- end
- @phase4_step = 6
- end
- #--------------------------------------------------------------------------
- # ● フレーム更新 (メインフェーズ ステップ 6 : リフレッシュ)
- #--------------------------------------------------------------------------
- def update_phase4_step6
-
- #我们询问玩家死亡和是一名球员或敌人…
- #这些线的运行和待机动画的…
- if @active_battler.is_a?(Game_Actor) and !@active_battler.dead?
- @spriteset.actor_sprites[@active_battler.index].move(@active_battler.screen_x, @active_battler.screen_y, 20)
- @spriteset.actor_sprites[@active_battler.index].pose(0)
- elsif !@active_battler.dead?
- @spriteset.enemy_sprites[@active_battler.index].move(@active_battler.screen_x, @active_battler.screen_y, 20)
- @spriteset.enemy_sprites[@active_battler.index].enemy_pose(0)
- end
- for target in @target_battlers
- if target.is_a?(Game_Actor) and !target.dead?
- @spriteset.actor_sprites[target.index].pose(1)
- elsif !target.dead?
- @spriteset.enemy_sprites[target.index].enemy_pose(1)
- end
- end
- $game_temp.forcing_battler = nil
- if @common_event_id > 0
- common_event = $data_common_events[@common_event_id]
- $game_system.battle_interpreter.setup(common_event.list, 0)
- end
- @phase4_step = 7
- end
- def update_phase4_step7
-
- #我们询问玩家死亡和是一名球员或敌人…
- #这些线的运行和待机动画的…
- if @active_battler.is_a?(Game_Actor) and !@active_battler.dead?
- @spriteset.actor_sprites[@active_battler.index].pose(1)
- elsif !@active_battler.dead?
- @spriteset.enemy_sprites[@active_battler.index].enemy_pose(1)
- end
- $game_temp.forcing_battler = nil
- if @common_event_id > 0
- common_event = $data_common_events[@common_event_id]
- $game_system.battle_interpreter.setup(common_event.list, 0)
- end
- @phase4_step = 1
- end
-
- #这是一个额外的…没有这个动画而无法正常工作的。.
- def update
- if $game_system.battle_interpreter.running?
- $game_system.battle_interpreter.update
- if $game_temp.forcing_battler == nil
- unless $game_system.battle_interpreter.running?
- unless judge
- setup_battle_event
- end
- end
- if @phase != 5
- @status_window.refresh
- end
- end
- end
- $game_system.update
- $game_screen.update
- if $game_system.timer_working and $game_system.timer == 0
- $game_temp.battle_abort = true
- end
- @help_window.update
- @party_command_window.update
- @actor_command_window.update
- @status_window.update
- @message_window.update
- @spriteset.update
- if $game_temp.transition_processing
- $game_temp.transition_processing = false
- if $game_temp.transition_name == ""
- Graphics.transition(20)
- else
- Graphics.transition(40, "Graphics/Transitions/" +
- $game_temp.transition_name)
- end
- end
- if $game_temp.message_window_showing
- return
- end
- if @spriteset.effect?
- return
- end
- if $game_temp.gameover
- $scene = Scene_Gameover.new
- return
- end
- if $game_temp.to_title
- $scene = Scene_Title.new
- return
- end
- if $game_temp.battle_abort
- $game_system.bgm_play($game_temp.map_bgm)
- battle_end(1)
- return
- end
- if @wait_count > 0
- @wait_count -= 1
- return
- end
- # 这一战役而持有的球员
- for actor in @spriteset.actor_sprites
- if actor.moving
- return
- end
- end
- # 这是敌人…
- for enemy in @spriteset.enemy_sprites
- if enemy.moving# and $game_system.animated_enemy
- return
- end
- end
-
- if $game_temp.forcing_battler == nil and
- $game_system.battle_interpreter.running?
- return
- end
- case @phase
- when 1
- update_phase1
- when 2
- update_phase2
- when 3
- update_phase3
- when 4
- update_phase4
- when 5
- update_phase5
- end
- end #==============================================================================
- # 结束的snipplet
- #如果你想评论,在这里只看scene_battle 4…
- #我加了一些评论以来RPG没有添加任何…
- #==============================================================================
- end
- #==============================================================================
- # 本脚本来自www.66RPG.com,使用和转载请保留此信息
- #==============================================================================
复制代码 |
|