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

Project1

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

[已经过期] 求怎么能让arpg脚本和 npc名称 脚本共存?

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
211 小时
注册时间
2011-10-2
帖子
35
跳转到指定楼层
1
发表于 2013-6-12 21:05:19 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
要么只显示伤害没有npc名字,掉个位子情况就反过来了……
不知道是哪位大神的脚本,
npc名称:
  1. #==============================================================================
  2. # 显示NPC名
  3. #------------------------------------------------------------------------------
  4. # 跟原版一样,EV开头的不显示,逗号后加颜色代码
  5. # 修改某事件名的方法:
  6. #   set_npc_name("新名", 事件ID, 地图ID, 是否永久生效)
  7. #     事件ID 为空时表示当前事件
  8. #     地图ID 为空时表示当前地图
  9. #     是否永久生效 默认永久,否则只允许修改当前地图
  10. #==============================================================================
  11. # 参数设定
  12. #==============================================================================
  13. module NPC
  14.   NAME_FONT = "黑体"
  15.   NAME_SIZE = 16
  16.   NAME_SHADOW = false
  17.   NAME_WIDTH = 120
  18. end
  19. #==============================================================================
  20. # 重定事件名
  21. #==============================================================================
  22. def set_npc_name(name, event_id = nil, map_id = nil, forever = true)
  23.   # 处理事件 ID
  24.   if event_id == nil
  25.     event_id = $game_map.interpreter.event_id
  26.   end
  27.   # 处理地图 ID
  28.   if map_id == nil
  29.     $game_map.events[event_id].name = name
  30.     map_id = $game_map.map_id
  31.   else
  32.     map_id = map_id
  33.   end
  34.   return unless forever
  35.   data = load_data(sprintf("Data/Map%03d.rvdata", map_id))
  36.   # 更改名
  37.   data.events[event_id].name = name
  38.   save_data(data, sprintf("Data/Map%03d.rvdata", map_id))
  39. end
  40. #==============================================================================
  41. # ■ Game_Character
  42. #==============================================================================
  43. class Game_Character
  44.   #--------------------------------------------------------------------------
  45.   # ◎ 定义实例变量
  46.   #--------------------------------------------------------------------------
  47.   attr_accessor :name                  # 名称
  48.   #--------------------------------------------------------------------------
  49.   # ◎ 初始化对象
  50.   #--------------------------------------------------------------------------
  51.   alias character_ini initialize
  52.   def initialize
  53.     character_ini
  54.     @name = ""
  55.   end
  56. end
  57. #==============================================================================
  58. # ■ Game_Event
  59. #==============================================================================
  60. class Game_Event < Game_Character
  61.   #--------------------------------------------------------------------------
  62.   # ◎ 定义实例变量
  63.   #--------------------------------------------------------------------------
  64.   attr_reader   :erased
  65.   #--------------------------------------------------------------------------
  66.   # ◎ 初始化对像
  67.   #     map_id : 地图 ID
  68.   #     event  : 事件 (RPG::Event)
  69.   #--------------------------------------------------------------------------
  70.   alias event_ini initialize
  71.   def initialize(map_id, event)
  72.     event_ini(map_id, event)
  73.     @name = @event.name
  74.   end
  75. end
  76. #==============================================================================
  77. # ■ Game_Player
  78. #==============================================================================
  79. class Game_Player < Game_Character
  80.   #--------------------------------------------------------------------------
  81.   # ◎ 获取角色名
  82.   #--------------------------------------------------------------------------
  83.   def name
  84.     return $game_party.members[0].name
  85.   end
  86. end
  87. #==============================================================================
  88. # ■ Game_Interpreter
  89. #==============================================================================
  90. class Game_Interpreter
  91.   #--------------------------------------------------------------------------
  92.   # ◎ 定义实例变量
  93.   #--------------------------------------------------------------------------
  94.   attr_reader   :event_id
  95. end
  96. #==============================================================================
  97. # ■ Sprite_Character
  98. #==============================================================================
  99. class Sprite_Character < Sprite_Base
  100.   #--------------------------------------------------------------------------
  101.   # ◎ 初始化对象
  102.   #     viewport  : 视区
  103.   #     character : 角色 (Game_Character)
  104.   #--------------------------------------------------------------------------
  105.   def initialize(viewport, character = nil)
  106.     super(viewport)
  107.     @character = character
  108.     @balloon_duration = 0
  109.     ## 名称
  110.     @name = @character.name
  111.     set_name_sprite
  112.     update
  113.   end
  114.   #--------------------------------------------------------------------------
  115.   # ◎ 释放
  116.   #--------------------------------------------------------------------------
  117.   def dispose
  118.     dispose_balloon
  119.     super
  120.     ##
  121.     return if @name_sprite == nil
  122.     @name_sprite.bitmap.dispose
  123.     @name_sprite.dispose
  124.   end
  125.   #--------------------------------------------------------------------------
  126.   # ● 更新画面
  127.   #--------------------------------------------------------------------------
  128.   def update
  129.     super
  130.     update_bitmap
  131.     self.visible = (not @character.transparent)
  132.     update_src_rect
  133.     self.x = @character.screen_x
  134.     self.y = @character.screen_y
  135.     self.z = @character.screen_z
  136.     self.opacity = @character.opacity
  137.     self.blend_type = @character.blend_type
  138.     self.bush_depth = @character.bush_depth
  139.     update_balloon
  140.     if @character.animation_id != 0
  141.       animation = $data_animations[@character.animation_id]
  142.       start_animation(animation)
  143.       @character.animation_id = 0
  144.     end
  145.     if @character.balloon_id != 0
  146.       @balloon_id = @character.balloon_id
  147.       start_balloon
  148.       @character.balloon_id = 0
  149.     end
  150.     ## 名称可视和跟随
  151.     unless @name_sprite == nil or @name_sprite.disposed?
  152.       if @character.is_a?(Game_Event) and @character.erased
  153.         @name_sprite.visible = false
  154.         return
  155.       else
  156.         @name_sprite.visible = true
  157.       end
  158.       if @character.is_a?(Game_Player) and @character.in_vehicle?
  159.         @name_sprite.visible = false
  160.         return
  161.       else
  162.         @name_sprite.visible = true
  163.       end
  164.       if @name != @character.name
  165.         @name = @character.name
  166.         refresh_name_sprite
  167.       end
  168.       @name_sprite.x = self.x - 80
  169.       @name_sprite.y = self.y - self.height - NPC::NAME_SIZE+2
  170.       @name_sprite.z = self.z+1
  171.     end
  172.   end
  173.   #--------------------------------------------------------------------------
  174.   # ○ 设定 NPC 名称
  175.   #--------------------------------------------------------------------------
  176.   def set_name_sprite
  177.     return if @character.name[0, 2] == "EV"
  178.     return if @character.name == ""
  179.     return if @character.character_name == ""
  180.     return if @character.is_a?(Game_Event) and @character.erased
  181.     @color_board = Window_Base.new(0,0,33,33)
  182.     @color_board.visible = false
  183.     @name_sprite = Sprite.new
  184.     @name_sprite.bitmap = Bitmap.new(NPC::NAME_WIDTH, NPC::NAME_SIZE+2)
  185.     @name_sprite.bitmap.font.name = NPC::NAME_FONT
  186.     @name_sprite.bitmap.font.size = NPC::NAME_SIZE
  187.     @name_sprite.bitmap.font.shadow = NPC::NAME_SHADOW
  188.     refresh_name_sprite
  189.   end
  190.   #--------------------------------------------------------------------------
  191.   # ○ 更新 NPC 名称
  192.   #--------------------------------------------------------------------------
  193.   def refresh_name_sprite
  194.     name,color_index = @name.split(/,/)
  195.     color_index = 0 if color_index == ""
  196.     @name_sprite.bitmap.font.color = @color_board.text_color(color_index.to_i)
  197.     @name_sprite.bitmap.clear
  198.     @name_sprite.bitmap.draw_text(0,0,160,NPC::NAME_SIZE+2,name,1)
  199.   end
  200. end
复制代码
然后是arpg:
  1. #==============================================================================
  2. # 显示NPC名
  3. #------------------------------------------------------------------------------
  4. # 跟原版一样,EV开头的不显示,逗号后加颜色代码
  5. # 修改某事件名的方法:
  6. #   set_npc_name("新名", 事件ID, 地图ID, 是否永久生效)
  7. #     事件ID 为空时表示当前事件
  8. #     地图ID 为空时表示当前地图
  9. #     是否永久生效 默认永久,否则只允许修改当前地图
  10. #==============================================================================
  11. # 参数设定
  12. #==============================================================================
  13. module NPC
  14.   NAME_FONT = "黑体"
  15.   NAME_SIZE = 16
  16.   NAME_SHADOW = false
  17.   NAME_WIDTH = 120
  18. end
  19. #==============================================================================
  20. # 重定事件名
  21. #==============================================================================
  22. def set_npc_name(name, event_id = nil, map_id = nil, forever = true)
  23.   # 处理事件 ID
  24.   if event_id == nil
  25.     event_id = $game_map.interpreter.event_id
  26.   end
  27.   # 处理地图 ID
  28.   if map_id == nil
  29.     $game_map.events[event_id].name = name
  30.     map_id = $game_map.map_id
  31.   else
  32.     map_id = map_id
  33.   end
  34.   return unless forever
  35.   data = load_data(sprintf("Data/Map%03d.rvdata", map_id))
  36.   # 更改名
  37.   data.events[event_id].name = name
  38.   save_data(data, sprintf("Data/Map%03d.rvdata", map_id))
  39. end
  40. #==============================================================================
  41. # ■ Game_Character
  42. #==============================================================================
  43. class Game_Character
  44.   #--------------------------------------------------------------------------
  45.   # ◎ 定义实例变量
  46.   #--------------------------------------------------------------------------
  47.   attr_accessor :name                  # 名称
  48.   #--------------------------------------------------------------------------
  49.   # ◎ 初始化对象
  50.   #--------------------------------------------------------------------------
  51.   alias character_ini initialize
  52.   def initialize
  53.     character_ini
  54.     @name = ""
  55.   end
  56. end
  57. #==============================================================================
  58. # ■ Game_Event
  59. #==============================================================================
  60. class Game_Event < Game_Character
  61.   #--------------------------------------------------------------------------
  62.   # ◎ 定义实例变量
  63.   #--------------------------------------------------------------------------
  64.   attr_reader   :erased
  65.   #--------------------------------------------------------------------------
  66.   # ◎ 初始化对像
  67.   #     map_id : 地图 ID
  68.   #     event  : 事件 (RPG::Event)
  69.   #--------------------------------------------------------------------------
  70.   alias event_ini initialize
  71.   def initialize(map_id, event)
  72.     event_ini(map_id, event)
  73.     @name = @event.name
  74.   end
  75. end
  76. #==============================================================================
  77. # ■ Game_Player
  78. #==============================================================================
  79. class Game_Player < Game_Character
  80.   #--------------------------------------------------------------------------
  81.   # ◎ 获取角色名
  82.   #--------------------------------------------------------------------------
  83.   def name
  84.     return $game_party.members[0].name
  85.   end
  86. end
  87. #==============================================================================
  88. # ■ Game_Interpreter
  89. #==============================================================================
  90. class Game_Interpreter
  91.   #--------------------------------------------------------------------------
  92.   # ◎ 定义实例变量
  93.   #--------------------------------------------------------------------------
  94.   attr_reader   :event_id
  95. end
  96. #==============================================================================
  97. # ■ Sprite_Character
  98. #==============================================================================
  99. class Sprite_Character < Sprite_Base
  100.   #--------------------------------------------------------------------------
  101.   # ◎ 初始化对象
  102.   #     viewport  : 视区
  103.   #     character : 角色 (Game_Character)
  104.   #--------------------------------------------------------------------------
  105.   def initialize(viewport, character = nil)
  106.     super(viewport)
  107.     @character = character
  108.     @balloon_duration = 0
  109.     ## 名称
  110.     @name = @character.name
  111.     set_name_sprite
  112.     update
  113.   end
  114.   #--------------------------------------------------------------------------
  115.   # ◎ 释放
  116.   #--------------------------------------------------------------------------
  117.   def dispose
  118.     dispose_balloon
  119.     super
  120.     ##
  121.     return if @name_sprite == nil
  122.     @name_sprite.bitmap.dispose
  123.     @name_sprite.dispose
  124.   end
  125.   #--------------------------------------------------------------------------
  126.   # ● 更新画面
  127.   #--------------------------------------------------------------------------
  128.   def update
  129.     super
  130.     update_bitmap
  131.     self.visible = (not @character.transparent)
  132.     update_src_rect
  133.     self.x = @character.screen_x
  134.     self.y = @character.screen_y
  135.     self.z = @character.screen_z
  136.     self.opacity = @character.opacity
  137.     self.blend_type = @character.blend_type
  138.     self.bush_depth = @character.bush_depth
  139.     update_balloon
  140.     if @character.animation_id != 0
  141.       animation = $data_animations[@character.animation_id]
  142.       start_animation(animation)
  143.       @character.animation_id = 0
  144.     end
  145.     if @character.balloon_id != 0
  146.       @balloon_id = @character.balloon_id
  147.       start_balloon
  148.       @character.balloon_id = 0
  149.     end
  150.     ## 名称可视和跟随
  151.     unless @name_sprite == nil or @name_sprite.disposed?
  152.       if @character.is_a?(Game_Event) and @character.erased
  153.         @name_sprite.visible = false
  154.         return
  155.       else
  156.         @name_sprite.visible = true
  157.       end
  158.       if @character.is_a?(Game_Player) and @character.in_vehicle?
  159.         @name_sprite.visible = false
  160.         return
  161.       else
  162.         @name_sprite.visible = true
  163.       end
  164.       if @name != @character.name
  165.         @name = @character.name
  166.         refresh_name_sprite
  167.       end
  168.       @name_sprite.x = self.x - 80
  169.       @name_sprite.y = self.y - self.height - NPC::NAME_SIZE+2
  170.       @name_sprite.z = self.z+1
  171.     end
  172.   end
  173.   #--------------------------------------------------------------------------
  174.   # ○ 设定 NPC 名称
  175.   #--------------------------------------------------------------------------
  176.   def set_name_sprite
  177.     return if @character.name[0, 2] == "EV"
  178.     return if @character.name == ""
  179.     return if @character.character_name == ""
  180.     return if @character.is_a?(Game_Event) and @character.erased
  181.     @color_board = Window_Base.new(0,0,33,33)
  182.     @color_board.visible = false
  183.     @name_sprite = Sprite.new
  184.     @name_sprite.bitmap = Bitmap.new(NPC::NAME_WIDTH, NPC::NAME_SIZE+2)
  185.     @name_sprite.bitmap.font.name = NPC::NAME_FONT
  186.     @name_sprite.bitmap.font.size = NPC::NAME_SIZE
  187.     @name_sprite.bitmap.font.shadow = NPC::NAME_SHADOW
  188.     refresh_name_sprite
  189.   end
  190.   #--------------------------------------------------------------------------
  191.   # ○ 更新 NPC 名称
  192.   #--------------------------------------------------------------------------
  193.   def refresh_name_sprite
  194.     name,color_index = @name.split(/,/)
  195.     color_index = 0 if color_index == ""
  196.     @name_sprite.bitmap.font.color = @color_board.text_color(color_index.to_i)
  197.     @name_sprite.bitmap.clear
  198.     @name_sprite.bitmap.draw_text(0,0,160,NPC::NAME_SIZE+2,name,1)
  199.   end
  200. end
复制代码
  1. #===============================================================================
  2. #** VX Input Module#输入脚本,没有什么需要更改的地方,54
  3. #===============================================================================

  4. module Input
  5.     @keys = []
  6.     @pressed = []
  7.     Mouse_Left = 1
  8.     Mouse_Right = 2
  9.     Mouse_Middle = 4
  10.     Back= 8
  11.     Tab = 9
  12.     Enter = 13
  13.     Shift = 16
  14.     Ctrl = 17
  15.     Alt = 18
  16.     Esc = 0x1B
  17.     LT = 0x25
  18.     UPs = 0x26  
  19.     RT = 0x27
  20.     DN = 0x28
  21.     Space = 32
  22.     Numberkeys = {}
  23.     Numberkeys[0] = 48
  24.     Numberkeys[1] = 49
  25.     Numberkeys[2] = 50
  26.     Numberkeys[3] = 51
  27.     Numberkeys[4] = 52
  28.     Numberkeys[5] = 53
  29.     Numberkeys[6] = 54
  30.     Numberkeys[7] = 55
  31.     Numberkeys[8] = 56
  32.     Numberkeys[9] = 57
  33.     Numberpad = {}
  34.     Numberpad[0] = 45
  35.     Numberpad[1] = 35
  36.     Numberpad[2] = 40
  37.     Numberpad[3] = 34
  38.     Numberpad[4] = 37
  39.     Numberpad[5] = 12
  40.     Numberpad[6] = 39
  41.     Numberpad[7] = 36
  42.     Numberpad[8] = 38
  43.     Numberpad[9] = 33
  44.     Letters = {}
  45.     Letters["A"] = 65
  46.     Letters["B"] = 66
  47.     Letters["C"] = 67
  48.     Letters["D"] = 68
  49.     Letters["E"] = 69
  50.     Letters["F"] = 70
  51.     Letters["G"] = 71
  52.     Letters["H"] = 72
  53.     Letters["I"] = 73
  54.     Letters["J"] = 74
  55.     Letters["K"] = 75
  56.     Letters["L"] = 76
  57.     Letters["M"] = 77
  58.     Letters["N"] = 78
  59.     Letters["O"] = 79
  60.     Letters["P"] = 80
  61.     Letters["Q"] = 81
  62.     Letters["R"] = 82
  63.     Letters["S"] = 83
  64.     Letters["T"] = 84
  65.     Letters["U"] = 85
  66.     Letters["V"] = 86
  67.     Letters["W"] = 87
  68.     Letters["X"] = 88
  69.     Letters["Y"] = 89
  70.     Letters["Z"] = 90
  71.     Fkeys = {}
  72.     Fkeys[1] = 112
  73.     Fkeys[2] = 113
  74.     Fkeys[3] = 114
  75.     Fkeys[4] = 115
  76.     Fkeys[5] = 116
  77.     Fkeys[6] = 117
  78.     Fkeys[7] = 118
  79.     Fkeys[8] = 119
  80.     Fkeys[9] = 120
  81.     Fkeys[10] = 121
  82.     Fkeys[11] = 122
  83.     Fkeys[12] = 123
  84.     Collon = 186
  85.     Equal = 187
  86.     Comma = 188
  87.     Underscore = 189
  88.     Dot = 190
  89.     Backslash = 191
  90.     Lb = 219
  91.     Rb = 221
  92.     Quote = 222
  93.     State = Win32API.new('user32','GetKeyState',['i'],'i')
  94.     Key = Win32API.new('user32','GetAsyncKeyState',['i'],'i')
  95. #-------------------------------------------------------------------------------
  96.     USED_KEYS = [Mouse_Left, Mouse_Right, Mouse_Middle]
  97. #-------------------------------------------------------------------------------
  98.   module_function
  99.     #--------------------------------------------------------------------------  
  100.     def Input.getstate(key)
  101.       return true unless State.call(key).between?(0, 1)
  102.       return false
  103.     end
  104.     #--------------------------------------------------------------------------
  105.     def Input.testkey(key)
  106.       Key.call(key) & 0x01 == 1
  107.     end
  108.     #--------------------------------------------------------------------------
  109.     def Input.update
  110.       @keys = []
  111.       @keys.push(Input::Mouse_Left) if Input.testkey(Input::Mouse_Left)
  112.       @keys.push(Input::Mouse_Right) if Input.testkey(Input::Mouse_Right)
  113.       @keys.push(Input::Back) if Input.testkey(Input::Back)
  114.       @keys.push(Input::Tab) if Input.testkey(Input::Tab)
  115.       @keys.push(Input::Enter) if Input.testkey(Input::Enter)
  116.       @keys.push(Input::Shift) if Input.testkey(Input::Shift)
  117.       @keys.push(Input::Ctrl) if Input.testkey(Input::Ctrl)
  118.       @keys.push(Input::Alt) if Input.testkey(Input::Alt)
  119.       @keys.push(Input::Esc) if Input.testkey(Input::Esc)
  120.       for key in Input::Letters.values
  121.         @keys.push(key) if Input.testkey(key)
  122.       end
  123.       for key in Input::Numberkeys.values
  124.         @keys.push(key) if Input.testkey(key)
  125.       end
  126.       for key in Input::Numberpad.values
  127.         @keys.push(key) if Input.testkey(key)
  128.       end
  129.       for key in Input::Fkeys.values
  130.         @keys.push(key) if Input.testkey(key)
  131.       end
  132.       @keys.push(Input::Collon) if Input.testkey(Input::Collon)
  133.       @keys.push(Input::Equal) if Input.testkey(Input::Equal)
  134.       @keys.push(Input::Comma) if Input.testkey(Input::Comma)
  135.       @keys.push(Input::Underscore) if Input.testkey(Input::Underscore)
  136.       @keys.push(Input::Dot) if Input.testkey(Input::Dot)
  137.       @keys.push(Input::Backslash) if Input.testkey(Input::Backslash)
  138.       @keys.push(Input::Lb) if Input.testkey(Input::Lb)
  139.       @keys.push(Input::Rb) if Input.testkey(Input::Rb)
  140.       @keys.push(Input::Quote) if Input.testkey(Input::Quote)
  141.       @keys.push(Input::Space) if Input.testkey(Input::Space)
  142.       @keys.push(Input::LT) if Input.testkey(Input::LT)
  143.       @keys.push(Input::UPs) if Input.testkey(Input::UPs)
  144.       @keys.push(Input::RT) if Input.testkey(Input::RT)
  145.       @keys.push(Input::DN) if Input.testkey(Input::DN)
  146.       @pressed = []
  147.       @pressed.push(Input::Space) if Input.getstate(Input::Space)
  148.       @pressed.push(Input::Mouse_Left) if Input.getstate(Input::Mouse_Left)
  149.       @pressed.push(Input::Mouse_Right) if Input.getstate(Input::Mouse_Right)
  150.       @pressed.push(Input::Back) if Input.getstate(Input::Back)
  151.       @pressed.push(Input::Tab) if Input.getstate(Input::Tab)
  152.       @pressed.push(Input::Enter) if Input.getstate(Input::Enter)
  153.       @pressed.push(Input::Shift) if Input.getstate(Input::Shift)
  154.       @pressed.push(Input::Ctrl) if Input.getstate(Input::Ctrl)
  155.       @pressed.push(Input::Alt) if Input.getstate(Input::Alt)
  156.       @pressed.push(Input::Esc) if Input.getstate(Input::Esc)
  157.       @pressed.push(Input::LT) if Input.getstate(Input::LT)
  158.       @pressed.push(Input::UPs) if Input.getstate(Input::UPs)
  159.       @pressed.push(Input::RT) if Input.getstate(Input::RT)
  160.       @pressed.push(Input::DN) if Input.getstate(Input::DN)
  161.       for key in Input::Numberkeys.values
  162.         @pressed.push(key) if Input.getstate(key)
  163.       end
  164.       for key in Input::Numberpad.values
  165.         @pressed.push(key) if Input.getstate(key)
  166.       end
  167.       for key in Input::Letters.values
  168.         @pressed.push(key) if Input.getstate(key)
  169.       end
  170.       for key in Input::Fkeys.values
  171.         @pressed.push(key) if Input.getstate(key)
  172.       end
  173.       @pressed.push(Input::Collon) if Input.getstate(Input::Collon)
  174.       @pressed.push(Input::Equal) if Input.getstate(Input::Equal)
  175.       @pressed.push(Input::Comma) if Input.getstate(Input::Comma)
  176.       @pressed.push(Input::Underscore) if Input.getstate(Input::Underscore)
  177.       @pressed.push(Input::Dot) if Input.getstate(Input::Dot)
  178.       @pressed.push(Input::Backslash) if Input.getstate(Input::Backslash)
  179.       @pressed.push(Input::Lb) if Input.getstate(Input::Lb)
  180.       @pressed.push(Input::Rb) if Input.getstate(Input::Rb)
  181.       @pressed.push(Input::Quote) if Input.getstate(Input::Quote)  
  182.     end
  183.     #--------------------------------------------------------------------------
  184.     def Input.triggerd?(key)
  185.       return true if @keys.include?(key)
  186.       return false
  187.     end
  188.     #--------------------------------------------------------------------------
  189.     def Input.pressed?(key)
  190.       return true if @pressed.include?(key)
  191.       return false
  192.     end
  193.   #--------------------------------------------------------------------------
  194.   # * 4 Diraction
  195.   #--------------------------------------------------------------------------
  196.   def Input.dir4
  197.     return 2 if Input.pressed?(Input::DN)
  198.     return 4 if Input.pressed?(Input::LT)
  199.     return 6 if Input.pressed?(Input::RT)
  200.     return 8 if Input.pressed?(Input::UPs)
  201.     return 0
  202.   end
  203.   #--------------------------------------------------------------------------
  204.   # * Trigger (key)
  205.   #--------------------------------------------------------------------------
  206.   def trigger?(key)
  207.     keys = []
  208.     case key
  209.     when Input::DOWN
  210.       keys.push(Input::DN)
  211.     when Input::UP
  212.       keys.push(Input::UPs)
  213.     when Input::LEFT
  214.       keys.push(Input::LT)
  215.     when Input::RIGHT
  216.       keys.push(Input::RT)
  217.     when Input::A
  218.       keys.push(Input::Shift)
  219.     when Input::B
  220.       keys.push(Input::Esc, Input::Numberpad[0])
  221.     when Input::C
  222.       keys.push(Input::Space, Input::Enter)
  223.     when Input::L
  224.       keys.push(Input::Letters["Q"])
  225.     when Input::R
  226.       keys.push(Input::Letters["W"])
  227.     when Input::X
  228.       keys.push(Input::Letters["A"])
  229.     when Input::Y
  230.       keys.push(Input::Letters["S"])
  231.     when Input::Z
  232.       keys.push(Input::Letters["D"])
  233.     when Input::F5
  234.       keys.push(Input::Fkeys[5])
  235.     when Input::F6
  236.       keys.push(Input::Fkeys[6])
  237.     when Input::F7
  238.       keys.push(Input::Fkeys[7])
  239.     when Input::F8
  240.       keys.push(Input::Fkeys[8])
  241.     when Input::F9
  242.       keys.push(Input::Fkeys[9])
  243.     when Input::CTRL
  244.       keys.push(Input::Ctrl)
  245.     when Input::ALT
  246.       keys.push(Input::Alt)
  247.     else
  248.       keys.push(key)
  249.     end
  250.     for k in keys
  251.      if Input.triggerd?(k)
  252.        return true
  253.      end
  254.    end
  255.    return false
  256. end
  257.   #--------------------------------------------------------------------------
  258.   # * Repeat (key)
  259.   #--------------------------------------------------------------------------
  260.   def repeat?(key)
  261.     keys = []
  262.     case key
  263.     when Input::DOWN
  264.       keys.push(Input::DN)
  265.     when Input::UP
  266.       keys.push(Input::UPs)
  267.     when Input::LEFT
  268.       keys.push(Input::LT)
  269.     when Input::RIGHT
  270.       keys.push(Input::RT)
  271.     when Input::A
  272.       keys.push(Input::Shift)
  273.     when Input::B
  274.       keys.push(Input::Esc, Input::Numberpad[0])
  275.     when Input::C
  276.       keys.push(Input::Space, Input::Enter)
  277.     when Input::L
  278.       keys.push(Input::Letters["Q"])
  279.     when Input::R
  280.       keys.push(Input::Letters["W"])
  281.     when Input::X
  282.       keys.push(Input::Letters["A"])
  283.     when Input::Y
  284.       keys.push(Input::Letters["S"])
  285.     when Input::Z
  286.       keys.push(Input::Letters["D"])
  287.     when Input::F5
  288.       keys.push(Input::Fkeys[5])
  289.     when Input::F6
  290.       keys.push(Input::Fkeys[6])
  291.     when Input::F7
  292.       keys.push(Input::Fkeys[7])
  293.     when Input::F8
  294.       keys.push(Input::Fkeys[8])
  295.     when Input::F9
  296.       keys.push(Input::Fkeys[9])
  297.     when Input::CTRL
  298.       keys.push(Input::Ctrl)
  299.     when Input::ALT
  300.       keys.push(Input::Alt)
  301.     else
  302.       keys.push(key)
  303.     end
  304.     for k in keys
  305.      if Input.triggerd?(k)
  306.        return true
  307.      end
  308.    end
  309.    return false
  310.   end     
  311.   #--------------------------------------------------------------------------
  312.   # * Press (key)
  313.   #--------------------------------------------------------------------------
  314.   def press?(key)
  315.     keys = []
  316.     case key
  317.     when Input::DOWN
  318.       keys.push(Input::DN)
  319.     when Input::UP
  320.       keys.push(Input::UPs)
  321.     when Input::LEFT
  322.       keys.push(Input::LT)
  323.     when Input::RIGHT
  324.       keys.push(Input::RT)
  325.     when Input::A
  326.       keys.push(Input::Shift)
  327.     when Input::B
  328.       keys.push(Input::Esc, Input::Numberpad[0])
  329.     when Input::C
  330.       keys.push(Input::Space, Input::Enter)
  331.     when Input::L
  332.       keys.push(Input::Letters["Q"])
  333.     when Input::R
  334.       keys.push(Input::Letters["W"])
  335.     when Input::X
  336.       keys.push(Input::Letters["A"])
  337.     when Input::Y
  338.       keys.push(Input::Letters["S"])
  339.     when Input::Z
  340.       keys.push(Input::Letters["D"])  
  341.     when Input::F5
  342.       keys.push(Input::Fkeys[5])
  343.     when Input::F6
  344.       keys.push(Input::Fkeys[6])
  345.     when Input::F7
  346.       keys.push(Input::Fkeys[7])
  347.     when Input::F8
  348.       keys.push(Input::Fkeys[8])
  349.     when Input::F9
  350.       keys.push(Input::Fkeys[9])
  351.     when Input::CTRL
  352.       keys.push(Input::Ctrl)
  353.     when Input::ALT
  354.       keys.push(Input::Alt)
  355.     else
  356.       keys.push(key)
  357.     end
  358.     for k in keys
  359.      if Input.pressed?(k)
  360.        return true
  361.      end
  362.    end
  363.    return false
  364.   end     
  365.   #--------------------------------------------------------------------------
  366.   # * Check (key)
  367.   #--------------------------------------------------------------------------
  368.   def check(key)
  369.     Win32API.new("user32","GetAsyncKeyState",['i'],'i').call(key) & 0x01 == 1  # key 0
  370.   end
  371.   #--------------------------------------------------------------------------
  372.   # * Mouse Update
  373.   #--------------------------------------------------------------------------
  374.   def mouse_update
  375.     @used_i = []
  376.     for i in USED_KEYS
  377.       x = check(i)
  378.       if x == true
  379.         @used_i.push(i)
  380.       end
  381.     end
  382.   end
  383.   #--------------------------------------------------------------------------
  384.   # * Short Write C
  385.   #--------------------------------------------------------------------------
  386.   def Input.C
  387.     Input.trigger?(C)
  388.   end
  389.   #--------------------------------------------------------------------------
  390.   # * Short Write B
  391.   #--------------------------------------------------------------------------
  392.   def Input.B
  393.     Input.trigger?(B)
  394.   end
  395.   #--------------------------------------------------------------------------
  396.   # * Short Write A
  397.   #--------------------------------------------------------------------------
  398.   def Input.A
  399.     Input.trigger?(A)
  400.   end
  401.   #--------------------------------------------------------------------------
  402.   # * Short Write Down
  403.   #--------------------------------------------------------------------------
  404.   def Input.Down
  405.     Input.trigger?(DOWN)
  406.   end
  407.   #--------------------------------------------------------------------------
  408.   # * Short Write Up
  409.   #--------------------------------------------------------------------------
  410.   def Input.Up
  411.     Input.trigger?(UP)
  412.   end
  413.   #--------------------------------------------------------------------------
  414.   # * Short Write Right
  415.   #--------------------------------------------------------------------------
  416.   def Input.Right
  417.     Input.trigger?(RIGHT)
  418.   end
  419.   #--------------------------------------------------------------------------
  420.   # * Short Write Left
  421.   #--------------------------------------------------------------------------
  422.   def Input.Left
  423.     Input.trigger?(LEFT)
  424.   end
  425.   #--------------------------------------------------------------------------
  426.   # * Anykey pressed?  ( A or B or C or Down or Up or Right or Left )
  427.   #--------------------------------------------------------------------------
  428.   def Input.Anykey
  429.     if A or B or C or Down or Up or Right or Left
  430.       return true
  431.     else
  432.       return false
  433.     end
  434.   end
  435.   def Input.name?(num)
  436.     return "MOUSE PRIMARY" if num==1
  437.     return "MOUSE SECONDARY" if num==2
  438.     return "MOUSE MIDDLE" if num==4
  439.     return "MOUSE 4TH" if num==5
  440.     return "MOUSE 5TH" if num==6
  441.     return "BACKSPACE" if num==8
  442.     return "TAB" if num==9
  443.     return "RETURN" if num==13
  444.     return "SHIFT" if num==16
  445.     return "CTLR" if num==17
  446.     return "ALT" if num==18
  447.     return "CAPS LOCK" if num==20
  448.     return "ESCAPE" if num==27
  449.     return "SPACE" if num==32
  450.     return "PGUP" if num==33
  451.     return "PGDN" if num==34
  452.     return "END" if num==35
  453.     return "HOME" if num==36
  454.     return "LEFT" if num==37
  455.     return "UP" if num==38
  456.     return "RIGHT" if num==39
  457.     return "DOWN" if num==40
  458.     return "SNAPSHOT" if num==44
  459.     return "INSERT" if num==45
  460.     return "DELETE" if num==46
  461.     return "0" if num==48
  462.     return "1" if num==49
  463.     return "2" if num==50
  464.     return "3" if num==51
  465.     return "4" if num==52
  466.     return "5" if num==53
  467.     return "6" if num==54
  468.     return "7" if num==55
  469.     return "8" if num==56
  470.     return "9" if num==57
  471.     return "A" if num==65
  472.     return "B" if num==66
  473.     return "C" if num==67
  474.     return "D" if num==68
  475.     return "E" if num==69
  476.     return "F" if num==70
  477.     return "G" if num==71
  478.     return "H" if num==72
  479.     return "I" if num==73
  480.     return "J" if num==74
  481.     return "K" if num==75
  482.     return "L" if num==76
  483.     return "M" if num==77
  484.     return "N" if num==78
  485.     return "O" if num==79
  486.     return "P" if num==80
  487.     return "Q" if num==81
  488.     return "R" if num==82
  489.     return "S" if num==83
  490.     return "T" if num==84
  491.     return "U" if num==85
  492.     return "V" if num==86
  493.     return "W" if num==87
  494.     return "X" if num==88
  495.     return "Y" if num==89
  496.     return "Z" if num==90
  497.     return "LWIN" if num==91
  498.     return "RWIN" if num==92
  499.     return "APPS" if num==93
  500.     return "0" if num==96
  501.     return "1" if num==97
  502.     return "2" if num==98
  503.     return "3" if num==99
  504.     return "4" if num==100
  505.     return "5" if num==101
  506.     return "6" if num==102
  507.     return "7" if num==103
  508.     return "8" if num==104
  509.     return "9" if num==105
  510.     return "*" if num==106
  511.     return "+" if num==107
  512.     return "-" if num==109
  513.     return "." if num==110
  514.     return "/" if num==111
  515.     return "F1" if num==112
  516.     return "F2" if num==113
  517.     return "F3" if num==114
  518.     return "F4" if num==115
  519.     return "F5" if num==116
  520.     return "F6" if num==117
  521.     return "F7" if num==118
  522.     return "F8" if num==119
  523.     return "F9" if num==120
  524.     return "F10" if num==121
  525.     return "F11" if num==122
  526.     return "F12" if num==123
  527.     return "NUM LOCK" if num==144
  528.     return "SCROLL LOCK" if num==145
  529.     return "LEFT SHIFT" if num==160
  530.     return "RIGHT SHIFT" if num==161
  531.     return "LEFT CTRL" if num==162
  532.     return "RIGHT CTRL" if num==163
  533.     return "LEFT ALT" if num==164
  534.     return "RIGHT ALT" if num==165
  535.     return ";" if num==186
  536.     return "=" if num==187
  537.     return "," if num==188
  538.     return "_" if num==189
  539.     return "." if num==190
  540.     return "/" if num==191
  541.     return "`" if num==192
  542.     return "[" if num==219
  543.     return " \\ " if num==220
  544.     return "]" if num==221
  545.     return "'" if num==222
  546.     return "??? - " + "#{num}"
  547.   end
  548. end
复制代码
  1. #==============================================================================
  2. # BlueFireGames ABS
  3. #原作者BlueFireGames
  4. #汉化by偶尔杀人越货
  5. #版权说明:
  6. #==============================================================================
  7. #------------------------------------------------------------------------------
  8. # Credits everything Done by BlueFireGames,
  9. #------------------------------------------------------------------------------
  10. # Para Criar um Inimigo, coloque os seguintes comentários:
  11. # Enemy ID - 敌人#编号-I D是的怪物数据库编号;比如1就是斯莱姆
  12. # Die Erase - Apaga o inimigo quando ele morrer morrer;
  13. # Die Switch Local A - 死亡事件对应打开的开关:A;
  14. # Die Switch Local B - 死亡事件对应打开的开关:B;
  15. # Die Switch Local C - 死亡事件对应打开的开关:C;
  16. # Die Switch Local D - 死亡事件对应打开的开关:D
  17. # Die Switch X - 怪物死后四否删除;1-删除 2-能复活的,比如那个开关
  18. # Die Variable X - 死亡变量,怪物死亡后关联的变量
  19. # Follow X - 跟随模式,是否跟随
  20. # Kill Weapon ID - 被杀武器,比如是某怪只能被某武器剑杀
  21. # Kill Skill ID - 被杀技能id,比如火怪只能被水球这个技能杀
  22. # Kill Item ID - 杀怪物的物品id:比如不死只能被召唤书杀
  23. #翻译by偶尔杀人越货,保留了原有注释
  24. #一些变量的注释:@animate_wait = 30和@ANIME = true是技能延时相关,可以自行添加近距武器延时
  25. #由于我不懂西班牙问,所以都是摸索出来的,大部分正确,少量错误的,见谅
  26. #------------------------------------------------------------------------------
  27. # CONFIGURAÇÃO GERAL
  28. #------------------------------------------------------------------------------
  29. module Crissaegrim_ABS
  30. #------------------------------------------------------------------------------
  31. #左攻击键位设定
  32. Right_Attack_Button = Input::Letters["A"]
  33. #------------------------------------------------------------------------------
  34. #右攻击键位设定
  35. Left_Attack_and_Shield_Button = Input::Letters["S"]
  36. #------------------------------------------------------------------------------
  37. # 1,2,3技能键位设定Input::Numberkeys方法继承input
  38. Skill_Button = {Input::Numberkeys[1] => 0,
  39.                 Input::Numberkeys[2] => 0,
  40.                 Input::Numberkeys[3] => 0,}
  41. #------------------------------------------------------------------------------
  42. # 4,5,6物品键位设定
  43. Item_Button = {Input::Numberkeys[4] => 0,
  44.                Input::Numberkeys[5] => 0,
  45.                Input::Numberkeys[6] => 0,}
  46. #------------------------------------------------------------------------------
  47. # Armas com animação
  48. # 近距武器攻击动画,这里可以改4/8向
  49. Animate_Weapons = {}
  50. Animate_Weapons[0] = ["_Attacking", 0]
  51. #------------------------------------------------------------------------------
  52. # 远距武器
  53. # Para criar uma arma de distância, copie: Distance_Weapons[S] = [T, U, V, W, X, Y, Z] e mude:
  54. # 远距离武器对应相应精灵行走图


  55. Distance_Weapons = {}
  56. Distance_Weapons[13] = ["$Arrow", 0, 6, 5, 30, 21, 22]
  57. Distance_Weapons[14] = ["$Arrow", 0, 6, 5, 30, 21, 22]
  58. Distance_Weapons[15] = ["$Arrow", 0, 6, 5, 30, 21, 22]
  59. Distance_Weapons[16] = ["$Arrow", 0, 6, 5, 30, 21, 22]
  60. Distance_Weapons[17] = ["$Arrow", 0, 6, 5, 30, 21, 22]
  61. Distance_Weapons[18] = ["$Arrow", 0, 6, 5, 30, 21, 22]
  62. Distance_Weapons[19] = ["$Arrow", 0, 6, 5, 30, 21, 22]
  63. Distance_Weapons[20] = ["$Arrow", 0, 6, 5, 30, 21, 22]
  64. Distance_Weapons[24] = ["Energy Ball", 0, 4, 5, 60,22]
  65. Distance_Weapons[25] = ["Energy Ball", 1, 4, 5, 60,22]
  66. #Distance_Weapons[26] = ["Energy Ball", 2, 4, 5, 60,22]
  67. #Distance_Weapons[27] = ["Energy Ball", 0, 4, 5, 60,22]
  68. #Distance_Weapons[28] = ["Energy Ball", 5, 4, 5, 60,22]
  69. #Distance_Weapons[29] = ["Energy Ball", 5, 4, 5, 60,22]
  70. #Distance_Weapons[24] = ["Energy Ball", 0, 4, 5, 60]
  71. Distance_Weapons[25] = ["Energy Ball", 1, 4, 5, 60,32,32]
  72. Distance_Weapons[26] = ["Energy Ball", 2, 4, 5, 60,32,32]
  73. Distance_Weapons[27] = ["Energy Ball", 0, 4, 5, 60,32,32]
  74. Distance_Weapons[28] = ["Energy Ball", 5, 4, 5, 60,32,32]#这里硬着头皮修改了一下
  75. Distance_Weapons[40] = ["$Arrow", 0, 6, 5, 30, 21, 22]

  76. #------------------------------------------------------------------------------
  77. # Skills com animação
  78. # 技能声音,就是嘴难听的那个,建议取消
  79. Animate_Skills = {}
  80. Animate_Skills[0] = ["_casting", 0]
  81. #------------------------------------------------------------------------------
  82. # 远距技能id对应魔法球精灵行走图
  83. # Para criar uma skill de distância, copie: Distance_Skills[U] = [V, W, X, Y, Z] e mude:
  84. # U:ID da skill, V:Char, W:Index do Char, X:Velocidade, Y:Distância, Z:Tempo de espera para atacar
  85. Distance_Skills = {}
  86. Distance_Skills[59] = ["Energy Ball", 0, 4, 5, 60]
  87. Distance_Skills[63] = ["Energy Ball", 7, 4, 5, 60]
  88. Distance_Skills[67] = ["Energy Ball", 3, 4, 5, 60]
  89. Distance_Skills[71] = ["Energy Ball", 2, 4, 5, 60]
  90. Distance_Skills[73] = ["Energy Ball", 1, 4, 5, 60]
  91. Distance_Skills[75] = ["Energy Ball", 4, 4, 5, 60]
  92. Distance_Skills[77] = ["Energy Ball", 3, 4, 5, 60]
  93. Distance_Skills[79] = ["Energy Ball", 5, 4, 5, 60]
  94. Distance_Skills[86] = ["Energy Ball", 7, 4, 5, 60]
  95. Distance_Skills[110] = ["Energy Ball", 7, 4, 5, 60]
  96. Distance_Skills[111] = ["$S_Light01", 0, 5, 20, 60]
  97. Distance_Skills[87] = ["$S_Slash01", 0, 6, 4, 60]
  98. Distance_Skills[131] = ["$S_Slash01", 0, 6, 4, 60]
  99. #------------------------------------------------------------------------------
  100. # 物品
  101. # Para criar um ítem com animação, copie: Animate_Weapons[X] = ["Y", Z] e mude X para o id da arma no database e Y para o prefixo do nome do char atacando, e Z para o Index do Char
  102. Animate_Items = {}
  103. Animate_Items[0] = ["_usingitem", 0]
  104. #------------------------------------------------------------------------------
  105. # 远距武器id对应精灵
  106. # Para criar um ítem de distância, copie: Distance_Items[T] = [U, V, W, X, Y, Z] e mude:
  107. # T:ID do item, U:Char, V:Index do Char, W:Velocidade, X:Distância, Y:Munição, Z:Tempo de espera para atacar
  108. Distance_Items = {}
  109. Distance_Items[16] = ["Energy Ball", 0, 6, 5, 16, 30]
  110. Distance_Items[18] = ["Energy Ball", 7, 6, 5, 18, 30]
  111. Distance_Items[20] = ["Energy Ball", 3, 6, 5, 20, 30]
  112. #------------------------------------------------------------------------------
  113. # Escudos, para que o herói use o escudo para se defender.
  114. # Para criar um escudo, copie: Shields[X] = ["Y"] e mude X para o id do escudo no database e Y para o nome do char usando o escudo
  115. # PS: O gráfico do char com escudo DEVE SER um gráfico sozinho.
  116. Shields = {}
  117. Shields[1] = ["_Shield", 0]
  118. #------------------------------------------------------------------------------
  119. # Animação qando o Herói passa de Level.
  120. # 升级动画
  121. LevelUp_Animation = 40
  122. #------------------------------------------------------------------------------
  123. # Animação do ataque do inimigo, copie  Enemy_atk_animation[X] = Y
  124. #怪物攻击动画设定
  125. # e mude o X para o ID do inimigo, e Y para o ID da animação.
  126. Enemy_atk_animation = {}
  127. Enemy_atk_animation[2] = 13
  128. Enemy_atk_animation[3] = 19
  129. #------------------------------------------------------------------------------
  130. end
  131. #==============================================================================

  132. #------------------------------------------------------------------------------
  133. # Game Character
  134. #------------------------------------------------------------------------------
  135. class Game_Character
  136.   attr_accessor :life
  137.   attr_accessor :mana
  138.   attr_accessor :damage
  139.   attr_accessor :show_droped_items
  140.   attr_accessor :critical
  141.   attr_accessor :wait_action
  142.   attr_accessor :wait_action2
  143.   attr_reader :enemy_id
  144.   attr_reader :erase
  145.   attr_reader :switch_local_a
  146.   attr_reader :switch_local_b
  147.   attr_reader :switch_local_c
  148.   attr_reader :switch_local_d
  149.   attr_reader :switch
  150.   attr_reader :variable
  151.   attr_reader :kill_weapon
  152.   attr_reader :kill_skill
  153.   attr_reader :kill_item
  154.   attr_reader :ENEMY_DEFFEND
  155.   alias crissaegrim_abs_gchar_initialize initialize
  156.   alias crissaegrim_abs_gchar_update update
  157.   def initialize
  158.     @enemy_id = 0
  159.     [url=home.php?mod=space&uid=86492]@life[/url] = 0
  160.     @mana = 0
  161.     @erase = false
  162.     @switch_local_a = false
  163.     @switch_local_b = false
  164.     @switch_local_c = false
  165.     @switch_local_d = false
  166.     @switch = 0
  167.     @variable = 0
  168.     @kill_weapon = 0
  169.     @kill_skill = 0
  170.     @kill_item = 0
  171.     @wait_action = 0
  172.     @wait_action2 = 0
  173.     @damage = nil
  174.     show_droped_items = nil
  175.     @critical = false
  176.     @ENEMY_DEFFEND = false
  177.     @drop1_display_wait = 0
  178.     @drop1 = nil
  179.     @drop2_display_wait = 0
  180.     @drop2 = nil
  181.     @drop3_display_wait = 0
  182.     @drop3 = nil
  183.     crissaegrim_abs_gchar_initialize
  184.   end
  185.   def update
  186.   if @drop1_display_wait > 0
  187.     @drop1_display_wait -= 1
  188.   elsif @drop1_display_wait <= 0
  189.     @drop1 = nil
  190.   end
  191.   if @drop2_display_wait > 0
  192.     @drop2_display_wait -= 1
  193.   elsif @drop2_display_wait <= 0
  194.     @drop2 = nil
  195.   end
  196.   if @drop3_display_wait > 0
  197.     @drop3_display_wait -= 1
  198.   elsif @drop3_display_wait <= 0
  199.     @drop3 = nil
  200.   end
  201.     crissaegrim_abs_gchar_update
  202.   end
  203. #------------------------------------------------------------------------------
  204.   def recive_atk_right(attacker)
  205.     attacker_status = (attacker.is_a?(Game_Event) ? attacker.enemy_status : $game_party.members[0])
  206.     receptor_status = (self.is_a?(Game_Event) ? self.enemy_status : $game_party.members[0])
  207.     dmg = receptor_status.make_attack_damage_value(attacker_status)
  208.     if self.is_a?(Game_Player)
  209.       $game_player.damage = dmg
  210.       receptor_status.attack_effect(attacker_status)
  211.       $scene = Scene_Gameover.new if $game_party.members[0].hp <= 0
  212.     elsif self.is_a?(Game_Event)
  213.       if @kill_weapon <= 0 and @kill_item <= 0 and @kill_skill <= 0
  214.         if self.ENEMY_DEFFEND == false
  215.         self.damage = dmg
  216.         receptor_status.apply_state_changes(attacker_status)
  217.         #receptor_status.attack_effect(attacker_status)
  218.         self.life -= dmg
  219.         elsif self.ENEMY_DEFFEND == true
  220.         self.damage ="Guard"
  221.         end
  222.         elsif @kill_weapon > 0 and $game_party.members[0].weapon_id == @kill_weapon
  223.           self.damage = dmg
  224.           receptor_status.apply_state_changes(attacker_status)
  225.           #receptor_status.attack_effect(attacker_status)
  226.           self.life -= dmg
  227.         end
  228.         self.kill_enemy if self.life <= 0
  229.       end
  230.     end
  231. #------------------------------------------------------------------------------
  232.   def recive_atk_left(attacker)
  233.     attacker_status = (attacker.is_a?(Game_Event) ? attacker.enemy_status : $game_party.members[0])
  234.     receptor_status = (self.is_a?(Game_Event) ? self.enemy_status : $game_party.members[0])
  235.     dmg = receptor_status.make_attack_damage_value(attacker_status)
  236.     if self.is_a?(Game_Player)
  237.       $game_player.damage = dmg
  238.       receptor_status.attack_effect(attacker_status)
  239.       $scene = Scene_Gameover.new if $game_party.members[0].hp <= 0
  240.     elsif self.is_a?(Game_Event)
  241.       if @kill_weapon <= 0 and @kill_item <= 0 and @kill_skill <= 0
  242.         self.damage = dmg
  243.         receptor_status.apply_state_changes(attacker_status)
  244.         #receptor_status.attack_effect(attacker_status)
  245.         self.life -= dmg
  246.         elsif @kill_weapon > 0 and $game_party.members[0].armor1_id == @kill_weapon
  247.           self.damage = dmg
  248.           receptor_status.apply_state_changes(attacker_status)
  249.           #receptor_status.attack_effect(attacker_status)
  250.           self.life -= dmg
  251.         end
  252.         self.kill_enemy if self.life <= 0
  253.       end
  254.     end
  255. #------------------------------------------------------------------------------
  256.   def recive_skill(attacker, skill)
  257.     attacker_status = (attacker.is_a?(Game_Event) ? attacker.enemy_status : $game_party.members[0])
  258.     receptor_status = (self.is_a?(Game_Event) ? self.enemy_status : $game_party.members[0])
  259.     dmg = receptor_status.make_obj_damage_value(receptor_status, $data_skills[skill])
  260.     if self.is_a?(Game_Player)
  261.       $game_player.damage = dmg
  262.       receptor_status.skill_effect(attacker_status, $data_skills[skill])
  263.       $scene = Scene_Gameover.new if $game_party.members[0].hp <= 0
  264.     elsif self.is_a?(Game_Event)
  265.     if @kill_weapon <= 0 and @kill_item <= 0 and @kill_skill <= 0
  266.       #receptor_status.skill_effect(attacker_status, $data_skills[skill])
  267.       self.damage = dmg
  268.       receptor_status.apply_state_changes(attacker_status)
  269.       self.life -= dmg
  270.     elsif @kill_skill > 0 and $data_skills[skill].id == @kill_skill
  271.       #receptor_status.skill_effect(attacker_status, $data_skills[skill])
  272.       self.damage = dmg
  273.       receptor_status.apply_state_changes(attacker_status)
  274.       self.life -= dmg
  275.     end
  276.   self.kill_enemy if self.life <= 0
  277. end
  278. end
  279. #------------------------------------------------------------------------------
  280.     def recive_itemeffect(attacker, item)
  281.       attacker_status = (attacker.is_a?(Game_Event) ? attacker.enemy_status : $game_party.members[0])
  282.       receptor_status = (self.is_a?(Game_Event) ? self.enemy_status : $game_party.members[0])
  283.       dmg = receptor_status.make_obj_damage_value(receptor_status, $data_items[item])
  284.     if self.is_a?(Game_Player)
  285.       $game_player.damage = dmag
  286.       receptor_status.item_effect(attacker_status, $data_items[item])
  287.       $scene = Scene_Gameover.new if $game_party.members[0].hp <= 0
  288.     elsif self.is_a?(Game_Event)
  289.       if @kill_weapon <= 0 and @kill_item <= 0 and @kill_skill <= 0
  290.         self.damage = dmg
  291.         receptor_status.apply_state_changes(attacker_status)
  292.         #receptor_status.item_effect(attacker_status, $data_items[item])
  293.         self.life -= dmg
  294.       elsif @kill_item > 0 and $data_items[item].id == @kill_item
  295.         self.damage = dmg
  296.         receptor_status.apply_state_changes(attacker_status)
  297.         #receptor_status.item_effect(attacker_status, $data_items[item])
  298.         self.life -= dmg
  299.       end
  300.       self.kill_enemy if self.life <= 0
  301.     end
  302.   end
  303. #------------------------------------------------------------------------------
  304. def kill_enemy
  305.   $game_party.members[0].gain_exp(self.enemy_status.exp, 1)
  306.   make_drop
  307.   if @erase == true
  308.     self.erase
  309.   elsif @switch_local_a == true
  310.     key = [$game_map.map_id, self.id, "A"]
  311.     if $game_self_switches[key] == false
  312.     $game_self_switches[key] = true
  313.   elsif $game_self_switches[key] == true
  314.     $game_self_switches[key] = false
  315.   end
  316.   elsif @switch_local_b == true
  317.     key = [$game_map.map_id, self.id, "B"]
  318.     if $game_self_switches[key] == false
  319.     $game_self_switches[key] = true
  320.   elsif $game_self_switches[key] == true
  321.     $game_self_switches[key] = false
  322.   end
  323.   elsif @switch_local_c == true
  324.     key = [$game_map.map_id, self.id, "C"]
  325.     if $game_self_switches[key] == false
  326.     $game_self_switches[key] = true
  327.   elsif $game_self_switches[key] == true
  328.     $game_self_switches[key] = false
  329.   end
  330.   elsif @switch_local_d == true
  331.     key = [$game_map.map_id, self.id, "D"]
  332.     if $game_self_switches[key] == false
  333.     $game_self_switches[key] = true
  334.   elsif $game_self_switches[key] == true
  335.     $game_self_switches[key] = false
  336.   end
  337.   elsif @switch > 0 and
  338.     if $game_switches[@switch] == false
  339.     $game_switches[@switch] = true
  340.   elsif $game_switches[@switch] == true
  341.     $game_switches[@switch] = false
  342.   end
  343.   elsif @variable > 0
  344.     $game_variables[@variable] += 1
  345.   end
  346.   $game_map.need_refresh = true
  347.   @automove = false
  348.   refresh
  349. end
  350. def make_drop
  351.   for item in make_items1
  352.     $game_party.gain_item(item, 1)
  353.     @drop1 = Sprite.new
  354.     @drop1.bitmap = Bitmap.new(200, 28)
  355.     @drop1.x = 0
  356.     @drop1.y = 150
  357.     @drop1.bitmap.font.size = 16
  358.     @drop1.bitmap.clear
  359.     @drop1.bitmap.font.color = Color.new(0,0,0)
  360.     @drop1.bitmap.draw_text(1,1,200,28, "#{item.name} 找到!")
  361.     @drop1.bitmap.font.color = Color.new(255,255,255)
  362.     @drop1.bitmap.draw_text(0,0,200,28, "#{item.name} 找到!")
  363.     @drop1_display_wait = 120
  364.   end
  365.   for item in make_items2
  366.     $game_party.gain_item(item, 1)
  367.     @drop2 = Sprite.new
  368.     @drop2.bitmap = Bitmap.new(200, 28)
  369.     @drop2.x = 0
  370.     @drop2.y = 178
  371.     @drop2.bitmap.font.size = 16
  372.     @drop2.bitmap.clear
  373.     @drop2.bitmap.font.color = Color.new(0,0,0)
  374.     @drop2.bitmap.draw_text(1,1,200,28, "#{item.name} 找到!")
  375.     @drop2.bitmap.font.color = Color.new(255,255,255)
  376.     @drop2.bitmap.draw_text(0,0,200,28, "#{item.name} 找到!")
  377.     @drop2_display_wait = 120
  378.   end
  379.   if self.enemy_status.gold > 0
  380.     $game_party.gain_gold(self.enemy_status.gold)
  381.     @drop3 = Sprite.new
  382.     @drop3.bitmap = Bitmap.new(200, 28)
  383.     @drop3.x = 0
  384.     @drop3.y = 206
  385.     @drop3.bitmap.font.size = 16
  386.     @drop3.bitmap.clear
  387.     @drop3.bitmap.font.color = Color.new(0,0,0)
  388.     @drop3.bitmap.draw_text(1,1,200,28, "$ #{self.enemy_status.gold} 找到!")
  389.     @drop3.bitmap.font.color = Color.new(255,255,255)
  390.     @drop3.bitmap.draw_text(0,0,200,28, "$ #{self.enemy_status.gold} 找到!")
  391.     @drop3_display_wait = 120
  392.     end
  393.   end
  394.   def make_items1
  395.     drop_items = []
  396.       for di in [self.enemy_status.drop_item1]
  397.         next if di.kind == 0
  398.         next if rand(di.denominator) != 0
  399.         index = [self.enemy_status.drop_item1, self.enemy_status.drop_item2].index(di)
  400.         if di.kind == 1
  401.           drop_items.push($data_items[di.item_id])
  402.         elsif di.kind == 2
  403.           drop_items.push($data_weapons[di.weapon_id])
  404.         elsif di.kind == 3
  405.           drop_items.push($data_armors[di.armor_id])
  406.         end
  407.       end
  408.     return drop_items
  409.   end
  410.   def make_items2
  411.     drop_items = []
  412.       for di in [self.enemy_status.drop_item2]
  413.         next if di.kind == 0
  414.         next if rand(di.denominator) != 0
  415.         index = [self.enemy_status.drop_item1, self.enemy_status.drop_item2].index(di)
  416.         if di.kind == 1
  417.           drop_items.push($data_items[di.item_id])
  418.         elsif di.kind == 2
  419.           drop_items.push($data_weapons[di.weapon_id])
  420.         elsif di.kind == 3
  421.           drop_items.push($data_armors[di.armor_id])
  422.         end
  423.       end
  424.     return drop_items
  425.   end
  426. end

  427. #------------------------------------------------------------------------------
  428. # Game Event
  429. #------------------------------------------------------------------------------
  430. class Game_Event < Game_Character
  431.   attr_reader :enemy_id
  432.   attr_reader :inimigo
  433.   attr_reader :enemy_status
  434.   attr_accessor :move_speed
  435.   attr_accessor :through
  436.   alias crissaegrim_abs_gevent_initialize initialize
  437.   alias crissaegrim_abs_gevent_update update
  438.   alias crissaegrim_abs_gevent_refresh refresh
  439.   def initialize(map_id, event)
  440.     @inimigo = false
  441.     @automove = false
  442.     @life = 0
  443.     @mana = 0
  444.     @ENEMY_DEFFEND = false
  445.     @enemy_die_animation = 0
  446.     crissaegrim_abs_gevent_initialize(map_id, event)
  447.   end
  448.   def update
  449.     crissaegrim_abs_gevent_update
  450.     if self.wait_action > 0
  451.       self.wait_action -= 1
  452.     end
  453.     if @inimigo
  454.       new_x = (@x + (@direction == 4 ? -1 : @direction == 6 ? 1 : 0))
  455.       new_y = (@y + (@direction == 8 ? -1 : @direction == 2 ? 1 : 0))
  456.       if $game_player.x == new_x and $game_player.y == new_y and self.wait_action <= 0
  457.         for action in $data_enemies[@enemy_id].actions
  458.           next unless enemy_status.conditions_met?(action)
  459.           case action.kind
  460.           when 0
  461.             case action.basic
  462.             when 0
  463. p = $game_player.direction
  464. e = self.direction
  465. if $game_player.DEFFEND == true and p == 2 and e == 8
  466.   $game_player.damage = "格挡!"
  467. elsif $game_player.DEFFEND == true and p == 4 and e == 6
  468.   $game_player.damage = "格挡!"
  469. elsif $game_player.DEFFEND == true and p == 6 and e == 4
  470.    $game_player.damage = "格挡!"
  471. elsif $game_player.DEFFEND == true and p == 8 and e == 2
  472.     $game_player.damage = "格挡!"
  473.   else
  474.   $game_player.recive_atk_right(self)
  475.   $game_player.animation_id = (Crissaegrim_ABS::Enemy_atk_animation[@enemy_id] ? Crissaegrim_ABS::Enemy_atk_animation[@enemy_id] : 1)
  476.   $game_player.jump(0,0)
  477. end
  478. when 1
  479. e = self.direction
  480. p = $game_player.direction
  481. if e == 2 and p == 8
  482.   @ENEMY_DEFFEND = true
  483. elsif e == 4 and p == 6
  484.   @ENEMY_DEFFEND = true
  485. elsif e == 6 and p == 4
  486.   @ENEMY_DEFFEND = true
  487. elsif e == 8 and p == 2
  488.   @ENEMY_DEFFEND = true
  489. else
  490.   @ENEMY_DEFFEND = false
  491. end
  492.   when 2..3
  493.     return
  494.     end
  495.     when 1
  496.       case $data_skills[action.skill_id].scope
  497.       when 1..6
  498.         if $data_enemies[@enemy_id].maxmp >= $data_skills[action.skill_id].mp_cost
  499.           $data_enemies[@enemy_id].maxmp -= $data_skills[action.skill_id].mp_cost
  500.   p = $game_player.direction
  501.   e = self.direction
  502.   if $game_player.DEFFEND == true and p == 2 and e == 8
  503.   $game_player.damage = "格挡!"#格挡
  504.   elsif $game_player.DEFFEND == true and p == 4 and e == 6
  505.   $game_player.damage = "格挡!"
  506.   elsif $game_player.DEFFEND == true and p == 6 and e == 4
  507.    $game_player.damage = "格挡!"
  508.   elsif $game_player.DEFFEND == true and p == 8 and e == 2
  509.     $game_player.damage = "格挡!"
  510.   else
  511.     $game_player.animation_id = $data_skills[action.skill_id].animation_id
  512.     $game_player.jump(0,0)
  513.     $game_player.recive_skill(self, action.skill_id)
  514.   end
  515.   end
  516.   when 7..11
  517.     if self.mana >= $data_skills[action.skill_id].mp_cost
  518.       self.mana -= $data_skills[action.skill_id].mp_cost
  519.       $game_temp.common_event_id = $data_skills[action.skill_id].common_event_id if $data_skills[action.skill_id].common_event_id > 0
  520. #      @enemy_status.skill_effect(@enemy_status, $data_skills[action.skill_id])
  521.       rec = @enemy_status.make_obj_damage_value(@enemy_status, $data_skills[action.skill_id])
  522.       self.life -= rec
  523.       self.life = $data_enemies[@enemy_id].maxhp if self.life > $data_enemies[@enemy_id].maxhp
  524.       self.damage = rec
  525.       self.animation_id = $data_skills[action.skill_id].animation_id
  526.       end
  527.     end
  528.   end
  529. end
  530.    speed = $data_enemies[@enemy_id].agi / 100
  531.    self.wait_action = 60 - speed
  532. end
  533. end
  534. if @automove
  535.   unless moving?
  536.     if in_range?(self, $game_player, @follow_distance)
  537.       self.move_toward_player
  538.     end
  539.   end
  540. end
  541. end
  542.   def refresh
  543.     crissaegrim_abs_gevent_refresh
  544.     @inimigo = false
  545.     @enemy_id = check_comment("Enemy")
  546.     @follow_distance = check_comment("Follow")
  547.     @erase = check_com("Die Erase")
  548.     @switch_local_a = check_com("Die Switch Local A")
  549.     @switch_local_b = check_com("Die Switch Local B")
  550.     @switch_local_c = check_com("Die Switch Local C")
  551.     @switch_local_d = check_com("Die Switch Local D")
  552.     @switch = check_comment("Die Switch")
  553.     @variable = check_comment("Die Variable")
  554.     @kill_weapon = check_comment("Kill Weapon")
  555.     @kill_skill = check_comment("Kill Skill")
  556.     @kill_item = check_comment("Kill Item")
  557.     @automove = true if @follow_distance > 0
  558.     if @enemy_id > 0
  559.       @inimigo = true
  560.       @enemy_status = GameABS_Enemy.new(@enemy_id)
  561.       @life = $data_enemies[@enemy_id].maxhp if @life <= 0
  562.       @mana = $data_enemies[@enemy_id].maxmp if @mana <= 0
  563.     end
  564.   end
  565.   def check_comment(comentario)
  566.     com = comentario.downcase
  567.     return 0 if @list.nil? or @list.size <= 0
  568.     for item in @list
  569.       if item.code == 108 or item.code == 408
  570.         if item.parameters[0].downcase =~ /#{com}[ ]?(\d+)?/
  571.           return $1.to_i
  572.         end
  573.       end
  574.     end
  575.     return 0
  576.   end
  577.   def check_com(comentario)
  578.     return false if @list.nil? or @list.size <= 0
  579.     for item in @list
  580.       if item.code == 108 or item.code == 408
  581.         if item.parameters[0].downcase.include?(comentario.downcase)
  582.           return true
  583.         end
  584.       end
  585.     end
  586.   end
  587.   def in_range?(event, target, distance)
  588.     x = (event.x - target.x) * (event.x - target.x)
  589.     y = (event.y - target.y) * (event.y - target.y)
  590.     r = x + y
  591.     return true if r <= (distance * distance)
  592.     return false
  593.   end
  594. end

  595. #------------------------------------------------------------------------------
  596. # Game Player
  597. #------------------------------------------------------------------------------
  598. class Game_Player < Game_Character
  599.   attr_accessor :ATAQUE_RIGHT
  600.   attr_accessor :ATAQUE_LEFT
  601.   attr_accessor :SKILL
  602.   attr_accessor :ITEM
  603.   attr_accessor :DEFFEND
  604.   attr_accessor :step_anime
  605.   alias crissaegrim_abs_gplayer_initialize initialize
  606.   alias crissaegrim_abs_gplayer_update update
  607.   def initialize
  608.     crissaegrim_abs_gplayer_initialize
  609.     @ATAQUE_RIGHT = false
  610.     @ATAQUE_LEFT = false
  611.     @SKILL = false
  612.     @ITEM = false
  613.     @DEFFEND = false
  614.     @ANIME = false
  615.     @animate_wait = 0
  616.   end
  617.   def update
  618.     crissaegrim_abs_gplayer_update
  619.     if self.wait_action > 0
  620.       self.wait_action -= 1
  621.     end
  622.     if self.wait_action2 > 0
  623.       self.wait_action2 -= 1
  624.     end
  625.     if @animate_wait > 0
  626.       @animate_wait -= 1
  627.     end
  628.     if @animate_wait <= 0
  629.       $game_player.set_graphic($game_actors[$game_party.members[0].id].character_name, $game_actors[$game_party.members[0].id].character_index)
  630.       $game_player.step_anime = false
  631.       @ANIME = false
  632.     end
  633. #------------------------------------------------------------------------------
  634.     if Input.trigger?(Crissaegrim_ABS::Right_Attack_Button) and self.wait_action <= 0 and @DEFFEND == false
  635.       @atk = $game_party.members[0].weapon_id
  636.       if $game_party.members[0].weapon_id != 0 and Crissaegrim_ABS::Animate_Weapons[@atk] != nil and Crissaegrim_ABS::Animate_Weapons[@atk] != 0 and Crissaegrim_ABS::Animate_Weapons[@atk][0] != nil and Crissaegrim_ABS::Animate_Weapons[@atk][0] != "" and @animate_wait <= 0
  637.         $game_player.set_graphic(self.character_name + Crissaegrim_ABS::Animate_Weapons[@atk][0], Crissaegrim_ABS::Animate_Weapons[@atk][1])
  638.         $game_player.step_anime = true
  639.         @animate_wait = 30
  640.         @ANIME = true
  641.       end
  642.       if Crissaegrim_ABS::Distance_Weapons.has_key?(@atk)
  643.         @ATAQUE_RIGHT = true
  644.       hero_x = ($game_player.x + ($game_player.direction == 4 ? -1 : $game_player.direction == 6 ? 1 : 0))
  645.       hero_y = ($game_player.y + ($game_player.direction == 8 ? -1 : $game_player.direction == 2 ? 1 : 0))
  646.       if  $game_party.has_item?($data_items[Crissaegrim_ABS::Distance_Weapons[@atk][5]])
  647.         $game_range.call($game_player.x,$game_player.y,Crissaegrim_ABS::Distance_Weapons[@atk][0],Crissaegrim_ABS::Distance_Weapons[@atk][1],Crissaegrim_ABS::Distance_Weapons[@atk][2],Crissaegrim_ABS::Distance_Weapons[@atk][3])
  648.         $game_party.consume_item($data_items[Crissaegrim_ABS::Distance_Weapons[@atk][5]])
  649.       end
  650.       self.wait_action = Crissaegrim_ABS::Distance_Weapons[@atk][4]
  651.     else
  652.     new_x = (@x + ($game_player.direction == 4 ? -1 : $game_player.direction == 6 ? 1 : 0))
  653.     new_y = (@y + ($game_player.direction == 8 ? -1 : $game_player.direction == 2 ? 1 : 0))
  654.       for event in $game_map.events.values
  655.         if event.inimigo
  656.           if event.x == new_x and event.y == new_y
  657.             event.recive_atk_right(self)
  658.             event.animation_id = $game_party.members[0].atk_animation_id
  659.             event.jump(0,0)
  660.             speed = $game_party.members[0].agi / 100
  661.             self.wait_action = 60 - speed
  662.             break
  663.           end
  664.         end
  665.       end
  666.     end
  667.      if Input.trigger?(Crissaegrim_ABS::Right_Attack_Button) and @animate_wait <= 0 and @DEFFEND == false and Crissaegrim_ABS::Distance_Weapons.has_key?(@atk)
  668.    @animate_wait = 30
  669.    @ANIME = true
  670.   $refreshon=1#hud刷新判断by杀人越货
  671.   ##开枪动画,需要的自己在这里放一个
  672. end#按下武器按键的时候显示动画
  673.   end
  674. #------------------------------------------------------------------------------
  675. if not $game_party.members[0].two_swords_style and $game_party.members[0].armor1_id > 0
  676.   if Input.press?(Crissaegrim_ABS::Left_Attack_and_Shield_Button)
  677.     @DEFFEND = true
  678.     if Crissaegrim_ABS::Shields[$game_party.members[0].armor1_id] != nil and Crissaegrim_ABS::Shields[$game_party.members[0].armor1_id] != 0 and Crissaegrim_ABS::Shields[$game_party.members[0].armor1_id][0] != nil and Crissaegrim_ABS::Shields[$game_party.members[0].armor1_id][0] != ""
  679.     $game_player.set_graphic(self.character_name + Crissaegrim_ABS::Shields[$game_party.members[0].armor1_id][0], Crissaegrim_ABS::Shields[$game_party.members[0].armor1_id][1])
  680.     end
  681.   else
  682.     @DEFFEND = false
  683.     if @ANIME == false
  684.     $game_player.set_graphic($game_actors[$game_party.members[0].id].character_name, $game_actors[$game_party.members[0].id].character_index)
  685.     end
  686.   end
  687. elsif not $game_party.members[0].two_hands_legal? and $game_party.members[0].weapon_id > 0
  688.   if Input.press?(Crissaegrim_ABS::Left_Attack_and_Shield_Button)
  689.     @DEFFEND = true
  690.     if Crissaegrim_ABS::Shields[$game_party.members[0].armor1_id] != nil and Crissaegrim_ABS::Shields[$game_party.members[0].armor1_id] != 0 and Crissaegrim_ABS::Shields[$game_party.members[0].armor1_id][0] != nil and Crissaegrim_ABS::Shields[$game_party.members[0].armor1_id][0] != ""
  691.     $game_player.set_graphic(self.character_name + Crissaegrim_ABS::Shields[$game_party.members[0].armor1_id][0], Crissaegrim_ABS::Shields[$game_party.members[0].armor1_id][1])
  692.     end
  693.   else
  694.     @DEFFEND = false
  695.     if @ANIME == false
  696.     $game_player.set_graphic($game_actors[$game_party.members[0].id].character_name, $game_actors[$game_party.members[0].id].character_index)
  697.     end
  698.   end
  699. elsif Input.trigger?(Crissaegrim_ABS::Left_Attack_and_Shield_Button) and self.wait_action2 <= 0
  700. if $game_party.members[0].two_hands_legal?
  701. @latk = $game_party.members[0].weapon_id
  702. else
  703. @latk = $game_party.members[0].armor1_id
  704. end
  705.       if $game_party.members[0].weapon_id != 0 and Crissaegrim_ABS::Animate_Weapons[@latk] != nil and Crissaegrim_ABS::Animate_Weapons[@latk][0] != "" and @animate_wait <= 0
  706.         $game_player.set_graphic(self.character_name + Crissaegrim_ABS::Animate_Weapons[@latk][0], Crissaegrim_ABS::Animate_Weapons[@latk][1])
  707.         $game_player.step_anime = true
  708.         @animate_wait = 30
  709.         @ANIME = true
  710.       elsif $game_party.members[0].armor1_id != 0 and Crissaegrim_ABS::Animate_Weapons[@latk] != nil and Crissaegrim_ABS::Animate_Weapons[@latk][0] != "" and @animate_wait <= 0
  711.         $game_player.set_graphic(self.character_name + Crissaegrim_ABS::Animate_Weapons[@latk][0], Crissaegrim_ABS::Animate_Weapons[@latk][1])
  712.         $game_player.step_anime = true
  713.         @animate_wait = 30
  714.         @ANIME = true
  715.       end
  716.       
  717.       
  718.       
  719.       if Crissaegrim_ABS::Distance_Weapons.has_key?(@latk)
  720.         @ATAQUE_LEFT = true   
  721.         $refreshon=1
  722.       hero_x = ($game_player.x + ($game_player.direction == 4 ? -1 : $game_player.direction == 6 ? 1 : 0))
  723.       hero_y = ($game_player.y + ($game_player.direction == 8 ? -1 : $game_player.direction == 2 ? 1 : 0))
  724.       if $game_map.passable?(hero_x, hero_y) or $game_map.passable?(hero_x, hero_y, 0x02)
  725.         if  $game_party.has_item?($data_items[Crissaegrim_ABS::Distance_Weapons[@latk][6]])
  726.           $game_range.call($game_player.x,$game_player.y,Crissaegrim_ABS::Distance_Weapons[@atk][0],Crissaegrim_ABS::Distance_Weapons[@atk][1],Crissaegrim_ABS::Distance_Weapons[@atk][2],Crissaegrim_ABS::Distance_Weapons[@atk][3])
  727.           $game_party.consume_item($data_items[Crissaegrim_ABS::Distance_Weapons[@latk][6]])
  728.         end
  729.         self.wait_action2 = Crissaegrim_ABS::Distance_Weapons[@latk][4]
  730.       end
  731.     else
  732.     new_x = (@x + ($game_player.direction == 4 ? -1 : $game_player.direction == 6 ? 1 : 0))
  733.     new_y = (@y + ($game_player.direction == 8 ? -1 : $game_player.direction == 2 ? 1 : 0))
  734.       for event in $game_map.events.values
  735.         if event.inimigo
  736.           if event.x == new_x and event.y == new_y
  737.             if $game_party.members[0].two_swords_style
  738.             event.animation_id = $game_party.members[0].atk_animation_id2
  739.             event.recive_atk_left(self)
  740.             event.jump(0,0)
  741.             end
  742.             speed = $game_party.members[0].agi / 100
  743.             self.wait_action2 = 60 - speed
  744.             break
  745.           end
  746.         end
  747.       end
  748.     end
  749.   end
  750. #------------------------------------------------------------------------------
  751.    for button in Crissaegrim_ABS::Skill_Button.keys
  752.     if Input.trigger?(button) and Crissaegrim_ABS::Skill_Button[button] != nil and Crissaegrim_ABS::Skill_Button[button] != 0 and $game_party.members[0].mp >= $data_skills[Crissaegrim_ABS::Skill_Button[button]].mp_cost and self.wait_action <= 0
  753.       @skl = Crissaegrim_ABS::Skill_Button[button]
  754.       if Crissaegrim_ABS::Animate_Skills[@skl] != nil and Crissaegrim_ABS::Animate_Skills[@skl] != 0 and Crissaegrim_ABS::Animate_Skills[@skl][0] != nil and Crissaegrim_ABS::Animate_Skills[@skl][0] != ""
  755.         $game_player.set_graphic(self.character_name + Crissaegrim_ABS::Animate_Skills[@skl][0], Crissaegrim_ABS::Animate_Skills[@skl][1])
  756.         $game_player.step_anime = true
  757.         @animate_wait = 30
  758.         @ANIME = true
  759.       end
  760.       $game_temp.common_event_id = $data_skills[@skl].common_event_id if $data_skills[@skl].common_event_id > 0
  761.       Sound.play_use_skill
  762.       if Crissaegrim_ABS::Distance_Skills.has_key?(@skl)
  763.         @SKILL = true
  764.         hero_x = ($game_player.x + ($game_player.direction == 4 ? -1 : $game_player.direction == 6 ? 1 : 0))
  765.         hero_y = ($game_player.y + ($game_player.direction == 8 ? -1 : $game_player.direction == 2 ? 1 : 0))
  766.       if $game_map.passable?(hero_x, hero_y) or $game_map.passable?(hero_x, hero_y, 0x02)
  767.       if $game_party.members[0].mp >= $data_skills[@skl].mp_cost
  768.         $game_range.call($game_player.x,$game_player.y,Crissaegrim_ABS::Distance_Skills[@skl][0],Crissaegrim_ABS::Distance_Skills[@skl][1],Crissaegrim_ABS::Distance_Skills[@skl][2],Crissaegrim_ABS::Distance_Skills[@skl][3])
  769.         $game_party.members[0].mp -= $game_party.members[0].calc_mp_cost($data_skills[@skl])
  770.       end
  771.       self.wait_action = Crissaegrim_ABS::Distance_Skills[@skl][4]
  772.     end
  773.   else
  774.     case $data_skills[@skl].scope
  775.       when 1..6
  776.       new_x = (@x + ($game_player.direction == 4 ? -1 : $game_player.direction == 6 ? 1 : 0))
  777.       new_y = (@y + ($game_player.direction == 8 ? -1 : $game_player.direction == 2 ? 1 : 0))
  778.       for event in $game_map.events.values
  779.         if event.inimigo
  780.           if event.x == new_x and event.y == new_y
  781.             $game_party.members[0].mp -= $game_party.members[0].calc_mp_cost($data_skills[@skl])
  782.             event.recive_skill(self, @skl)
  783.             event.animation_id = $data_skills[@skl].animation_id
  784.             event.jump(0,0)
  785.           end
  786.         end
  787.       end
  788.       when 7..11
  789.         $game_party.members[0].mp -= $game_party.members[0].calc_mp_cost($data_skills[@skl])
  790.         $game_party.members[0].skill_effect($game_party.members[0], $data_skills[@skl])
  791.         rec = $game_party.members[0].make_obj_damage_value($game_party.members[0], $data_skills[@skl])
  792.         self.damage = rec
  793.         $game_player.animation_id = $data_skills[@skl].animation_id
  794.         end
  795.         speed = $game_party.members[0].agi / 100
  796.         self.wait_action = 60 - speed
  797.         break
  798.       end
  799.     end
  800.   end
  801. #------------------------------------------------------------------------------
  802.   for button in Crissaegrim_ABS::Item_Button.keys
  803.     if Input.trigger?(button) and Crissaegrim_ABS::Item_Button[button] != nil and Crissaegrim_ABS::Item_Button[button] != 0 and $game_party.item_number($data_items[Crissaegrim_ABS::Item_Button[button]]) > 0 and self.wait_action <= 0
  804.       @itm = Crissaegrim_ABS::Item_Button[button]
  805.       $refreshon==1#这里做了修改,by偶尔杀人越货
  806.       #$game_player.animation_id = 动画
  807.       if Crissaegrim_ABS::Animate_Items[@itm] != nil and Crissaegrim_ABS::Animate_Items[@itm] != 0 and Crissaegrim_ABS::Animate_Items[@itm][0] != nil and Crissaegrim_ABS::Animate_Items[@itm][0] != ""
  808.         $game_player.set_graphic(self.character_name + Crissaegrim_ABS::Animate_Items[@itm][0], Crissaegrim_ABS::Animate_Items[@itm][1])
  809.         $game_player.step_anime = true
  810.         @animate_wait = 30
  811.         @ANIME = true
  812.       end
  813.       $game_temp.common_event_id = $data_items[@itm].common_event_id if $data_items[@itm].common_event_id > 0
  814.       Sound.play_use_item
  815.       if Crissaegrim_ABS::Distance_Items.has_key?(@itm)
  816.         @ITEM = true
  817.         hero_x = ($game_player.x + ($game_player.direction == 4 ? -1 : $game_player.direction == 6 ? 1 : 0))
  818.         hero_y = ($game_player.y + ($game_player.direction == 8 ? -1 : $game_player.direction == 2 ? 1 : 0))
  819.       if $game_map.passable?(hero_x, hero_y) or $game_map.passable?(hero_x, hero_y, 0x02)
  820.       if $game_party.has_item?($data_items[Crissaegrim_ABS::Distance_Items[@itm][4]])
  821.         $game_range.call($game_player.x,$game_player.y,Crissaegrim_ABS::Distance_Items[@itm][0],Crissaegrim_ABS::Distance_Items[@itm][1],Crissaegrim_ABS::Distance_Items[@itm][2],Crissaegrim_ABS::Distance_Items[@itm][3])
  822.         $game_party.consume_item($data_items[Crissaegrim_ABS::Distance_Items[@itm][4]])
  823.       end
  824.       self.wait_action = Crissaegrim_ABS::Distance_Items[@itm][5]
  825.     end
  826.       else
  827.       case $data_items[@itm].scope
  828.       when 1..6
  829.         new_x = (@x + ($game_player.direction == 4 ? -1 : $game_player.direction == 6 ? 1 : 0))
  830.         new_y = (@y + ($game_player.direction == 8 ? -1 : $game_player.direction == 2 ? 1 : 0))
  831.       for event in $game_map.events.values
  832.         if event.inimigo
  833.           if event.x == new_x and event.y == new_y
  834.             event.recive_itemeffect(self, @itm)
  835.             event.animation_id = $data_items[@itm].animation_id
  836.             $game_party.consume_item($data_items[@itm])
  837.             event.jump(0,0)
  838.           end
  839.         end
  840.       end
  841.       when 7..11
  842.       $game_player.animation_id = $data_items[@itm].animation_id
  843.       $game_party.members[0].item_effect($game_party.members[0], $data_items[@itm])
  844.       $game_party.consume_item($data_items[@itm])
  845.       $game_temp.common_event_id = $data_items[@itm].common_event_id if $data_items[@itm].common_event_id > 0
  846.     end
  847.     speed = $game_party.members[0].agi / 100
  848.     self.wait_action = 60 - speed
  849.   end
  850. end
  851. end
  852. #------------------------------------------------------------------------------
  853.   for event in $game_map.events.values
  854.   if event.inimigo
  855.     new_x = (event.x + ($game_range.direction == 4 ? 1 : $game_range.direction == 6 ? -1 : 0))
  856.     new_y = (event.y + ($game_range.direction == 8 ? 1 : $game_range.direction == 2 ? -1 : 0))
  857.     if $game_range.x == new_x and $game_range.y == new_y
  858.       if @ATAQUE_RIGHT == true
  859.         if $game_party.members[0].two_swords_style
  860.           if Crissaegrim_ABS::Distance_Weapons.has_key?($game_party.members[0].weapon_id)
  861.             event.animation_id = $data_items[Crissaegrim_ABS::Distance_Weapons[$game_party.members[0].weapon_id][5]].animation_id
  862.           else
  863.           event.animation_id = $game_party.members[0].atk_animation_id2
  864.           end
  865.         else
  866.           if Crissaegrim_ABS::Distance_Weapons.has_key?($game_party.members[0].armor1_id)
  867.             event.animation_id = $data_items[Crissaegrim_ABS::Distance_Weapons[$game_party.members[0].armor_1_id][5]].animation_id
  868.             else
  869.           event.animation_id = $game_party.members[0].atk_animation_id
  870.           end
  871.         end
  872.         event.recive_atk_right(self)
  873.       elsif @ATAQUE_LEFT == true
  874.         if $game_party.members[0].two_swords_style
  875.           if Crissaegrim_ABS::Distance_Weapons.has_key?($game_party.members[0].weapon_id)
  876.             event.animation_id = $data_items[Crissaegrim_ABS::Distance_Weapons[$game_party.members[0].weapon_id][6]].animation_id
  877.           else
  878.           event.animation_id = $game_party.members[0].atk_animation_id2
  879.           end
  880.         elsif $game_party.members[0].two_hands_legal?
  881.           if Crissaegrim_ABS::Distance_Weapons.has_key?($game_party.members[0].weapon_id)
  882.             event.animation_id = $data_items[Crissaegrim_ABS::Distance_Weapons[$game_party.members[0].weapon_id][6]].animation_id
  883.           else
  884.           event.animation_id = $game_party.members[0].atk_animation_id
  885.         end
  886.       end
  887.           event.recive_atk_left(self)
  888.         elsif @SKILL == true
  889.           event.animation_id = $data_skills[@skl].animation_id
  890.           event.recive_skill(self, @skl)
  891.           elsif @ITEM == true
  892.             event.animation_id = $data_items[@itm].animation_id
  893.             event.recive_itemeffect(self, @itm)
  894.           end
  895.           $game_range.destroy
  896.             event.jump(0,0)
  897.             @ATAQUE_RIGHT = false
  898.             @SKILL = false
  899.             @ITEM = false
  900.           end
  901.         end
  902.       end
  903.     end
  904.   end

  905. #------------------------------------------------------------------------------
  906. # Game Actor
  907. #------------------------------------------------------------------------------
  908. class Game_Actor
  909.   alias crissaegrim_abs_change_exp change_exp
  910.   def change_exp(exp, show)
  911.     last_level = @level
  912.     last_skills = skills
  913.     @exp = [[exp, 9999999].min, 0].max
  914.     while @exp >= @exp_list[@level+1] and @exp_list[@level+1] > 0
  915.       level_up
  916.     end
  917.     while @exp < @exp_list[@level]
  918.       level_down
  919.     end
  920.     @hp = [@hp, maxhp].min
  921.     @mp = [@mp, maxmp].min
  922.     if show and @level > last_level
  923.       show_level_up
  924.     end
  925.     crissaegrim_abs_change_exp(exp,show)
  926.   end
  927.   def show_level_up
  928.     $game_player.animation_id = Crissaegrim_ABS::LevelUp_Animation
  929.     $game_party.members[0].hp = $game_party.members[0].maxhp
  930.     $game_party.members[0].mp = $game_party.members[0].maxmp
  931.     $game_player.damage = "Level Up"
  932.   end
  933. end

  934. #------------------------------------------------------------------------------
  935. # Game ABS Enemy
  936. #------------------------------------------------------------------------------
  937. class GameABS_Enemy < Game_Battler
  938.   attr_reader   :enemy_id
  939.   def initialize(enemy_id)
  940.     super()
  941.     @enemy_id = enemy_id
  942.     enemy = $data_enemies[@enemy_id]
  943.     @hp = maxhp
  944.     @mp = maxmp
  945.   end
  946.   def actor?
  947.     return false
  948.   end
  949.   def enemy
  950.     return $data_enemies[@enemy_id]
  951.   end
  952.   def base_maxhp
  953.     return enemy.maxhp
  954.   end
  955.   def base_maxmp
  956.     return enemy.maxmp
  957.   end
  958.   def base_atk
  959.     return enemy.atk
  960.   end
  961.   def base_def
  962.     return enemy.def
  963.   end
  964.   def base_spi
  965.     return enemy.spi
  966.   end
  967.   def base_agi
  968.     return enemy.agi
  969.   end
  970.   def hit
  971.     return enemy.hit
  972.   end
  973.   def eva
  974.     return enemy.eva
  975.   end
  976.   def cri
  977.     return enemy.has_critical ? 10 : 0
  978.   end
  979.   def odds
  980.     return 1
  981.   end
  982.   def element_rate(element_id)
  983.     rank = enemy.element_ranks[element_id]
  984.     result = [0,200,150,100,50,0,-100][rank]
  985.     for state in states
  986.       result /= 2 if state.element_set.include?(element_id)
  987.     end
  988.     return result
  989.   end
  990.   def state_probability(state_id)
  991.     if $data_states[state_id].nonresistance
  992.       return 100
  993.     else
  994.       rank = enemy.state_ranks[state_id]
  995.       return [0,100,80,60,40,20,0][rank]
  996.     end
  997.   end
  998.   def exp
  999.     return enemy.exp
  1000.   end
  1001.   def gold
  1002.     return enemy.gold
  1003.   end
  1004.   def drop_item1
  1005.     return enemy.drop_item1
  1006.   end
  1007.   def drop_item2
  1008.     return enemy.drop_item2
  1009.   end
  1010.   def use_sprite?
  1011.     return true
  1012.   end
  1013.   def perform_collapse
  1014.     if $game_temp.in_battle and dead?
  1015.       @collapse = true
  1016.       Sound.play_enemy_collapse
  1017.     end
  1018.   end
  1019.   def escape
  1020.     @hidden = true
  1021.     @action.clear
  1022.   end
  1023.   def transform(enemy_id)
  1024.     @enemy_id = enemy_id
  1025.     if enemy.name != @original_name
  1026.       @original_name = enemy.name
  1027.       @letter = ''
  1028.       @plural = false
  1029.     end
  1030.     @battler_name = enemy.battler_name
  1031.     @battler_hue = enemy.battler_hue
  1032.     make_action
  1033.   end
  1034.   def conditions_met?(action)
  1035.     case action.condition_type
  1036.     when 1
  1037.       n = $game_troop.turn_count
  1038.       a = action.condition_param1
  1039.       b = action.condition_param2
  1040.       return false if (b == 0 and n != a)
  1041.       return false if (b > 0 and (n < 1 or n < a or n % b != a % b))
  1042.     when 2
  1043.       hp_rate = hp * 100.0 / maxhp
  1044.       return false if hp_rate < action.condition_param1
  1045.       return false if hp_rate > action.condition_param2
  1046.     when 3
  1047.       mp_rate = mp * 100.0 / maxmp
  1048.       return false if mp_rate < action.condition_param1
  1049.       return false if mp_rate > action.condition_param2
  1050.     when 4
  1051.       return false unless state?(action.condition_param1)
  1052.     when 5
  1053.       return false if $game_party.max_level < action.condition_param1
  1054.     when 6
  1055.       switch_id = action.condition_param1
  1056.       return false if $game_switches[switch_id] == false
  1057.     end
  1058.     return true
  1059.   end
  1060.   def make_action
  1061.     @action.clear
  1062.     return unless movable?
  1063.     available_actions = []
  1064.     rating_max = 0
  1065.     for action in enemy.actions
  1066.       next unless conditions_met?(action)
  1067.       if action.kind == 1
  1068.         next unless skill_can_use?($data_skills[action.skill_id])
  1069.       end
  1070.       available_actions.push(action)
  1071.       rating_max = [rating_max, action.rating].max
  1072.     end
  1073.     ratings_total = 0
  1074.     rating_zero = rating_max - 3
  1075.     for action in available_actions
  1076.       next if action.rating <= rating_zero
  1077.       ratings_total += action.rating - rating_zero
  1078.     end
  1079.     return if ratings_total == 0
  1080.     value = rand(ratings_total)
  1081.     for action in available_actions
  1082.       next if action.rating <= rating_zero
  1083.       if value < action.rating - rating_zero
  1084.         @action.kind = action.kind
  1085.         @action.basic = action.basic
  1086.         @action.skill_id = action.skill_id
  1087.         @action.decide_random_target
  1088.         return
  1089.       else
  1090.         value -= action.rating - rating_zero
  1091.       end
  1092.     end
  1093.   end
  1094. end

  1095. #------------------------------------------------------------------------------
  1096. # Game Range
  1097. #------------------------------------------------------------------------------
  1098. class Game_Range < Game_Character
  1099.   def initialize
  1100.     super
  1101.     @start_x = 0
  1102.     @start_y = 0
  1103.     @character_name = ""
  1104.     @character_index = 0
  1105.     @speed = 0
  1106.     @distance = 0
  1107.     @step = 0
  1108.   end
  1109.   def call(start_x,start_y,chara_name="",chara_index=0,speed=4,distance=0)
  1110.     @start_x = start_x
  1111.     @start_y = start_y
  1112.     @character_name = chara_name
  1113.     @character_index = chara_index
  1114.     @speed = speed
  1115.     @distance = distance
  1116.     @step = 0
  1117.     @direction = $game_player.direction
  1118.     case $game_player.direction
  1119.     when 2
  1120.       moveto(@start_x,@start_y+1)
  1121.     when 4
  1122.       moveto(@start_x-1,@start_y)
  1123.     when 6
  1124.       moveto(@start_x+1,@start_y)
  1125.     when 8
  1126.       moveto(@start_x,@start_y-1)
  1127.     end
  1128.   end
  1129.   def destroy
  1130.     @start_x = 0
  1131.     @start_y = 0
  1132.     @dist_x = 0
  1133.     @dist_y = 0
  1134.     @character_name = ""
  1135.     @character_index = 0
  1136.     @distance = 0
  1137.     @step = 0
  1138.     moveto(0,0)
  1139.   end
  1140.   def move_route
  1141.     return unless movable?
  1142.     return if $game_map.interpreter.running?
  1143.     @move_speed = @speed
  1144.     case @direction
  1145.     when 2
  1146.       move_down
  1147.     when 4
  1148.       move_left
  1149.     when 6
  1150.       move_right
  1151.     when 8
  1152.       move_up
  1153.     end
  1154.     @step += 1
  1155.   end
  1156.   def update
  1157.     return destroy if @step >= @distance
  1158.     move_route
  1159.     super
  1160.   end
  1161.   def movable?
  1162.     return false if moving?
  1163.     return false if @move_route_forcing
  1164.     return true
  1165.   end
  1166.   def check_event_trigger_touch(x, y)
  1167.   end
  1168. end

  1169. #------------------------------------------------------------------------------
  1170. # Sprite Base
  1171. #------------------------------------------------------------------------------
  1172.   class Sprite_Base
  1173.   alias animation animation_set_sprites
  1174. def animation_set_sprites(frame)
  1175.     cell_data = frame.cell_data
  1176.     for i in 0..15
  1177.       sprite = @animation_sprites[i]
  1178.       next if sprite == nil
  1179.       pattern = cell_data[i, 0]
  1180.       if pattern == nil or pattern == -1
  1181.         sprite.visible = false
  1182.         next
  1183.       end
  1184.       if pattern < 100
  1185.         sprite.bitmap = @animation_bitmap1
  1186.       else
  1187.         sprite.bitmap = @animation_bitmap2
  1188.       end
  1189.       sprite.visible = true
  1190.       sprite.src_rect.set(pattern % 5 * 192,
  1191.         pattern % 100 / 5 * 192, 192, 192)
  1192.       if @animation_mirror
  1193.         sprite.x = @animation_ox - cell_data[i, 1] / 2
  1194.         sprite.y = @animation_oy - cell_data[i, 2] / 2
  1195.         sprite.angle = (360 - cell_data[i, 4])
  1196.         sprite.mirror = (cell_data[i, 5] == 0)
  1197.       else
  1198.         sprite.x = @animation_ox + cell_data[i, 1] / 2
  1199.         sprite.y = @animation_oy + cell_data[i, 2] / 2
  1200.         sprite.angle = cell_data[i, 4]
  1201.         sprite.mirror = (cell_data[i, 5] == 1)
  1202.       end
  1203.       sprite.z = self.z + 300
  1204.       sprite.ox = 96
  1205.       sprite.oy = 96
  1206.       sprite.zoom_x = cell_data[i, 3] / 200.0
  1207.       sprite.zoom_y = cell_data[i, 3] / 200.0
  1208.       sprite.opacity = cell_data[i, 6] * self.opacity / 255.0
  1209.       sprite.blend_type = cell_data[i, 7]
  1210.     end
  1211.   end
  1212. end

  1213. #------------------------------------------------------------------------------
  1214. # Sprite Character
  1215. #------------------------------------------------------------------------------
  1216. class Sprite_Character < Sprite_Base
  1217.   alias crissaegrim_abs_spchar_update update
  1218.   def initialize(viewport, character = nil)
  1219.     super(viewport)
  1220.     @character = character
  1221.     @balloon_duration = 0
  1222.     @_damage_duration = 0
  1223.     update
  1224.   end
  1225.   def update
  1226.     super
  1227.     if @_damage_duration > 0
  1228.       @_damage_duration -=1
  1229.         @_damage_sprite.x = self.x
  1230.         if @_damage_duration <= 0
  1231.           dispose_damage
  1232.         end
  1233.       end
  1234.       if @character != nil and @character.damage != nil
  1235.       damage(@character.damage, @character.critical)
  1236.       @character.damage = nil
  1237.       @character.critical = false
  1238.     end
  1239.     crissaegrim_abs_spchar_update
  1240.   end
  1241.   def damage(value, critical)
  1242.       dispose_damage
  1243.       if value.is_a?(Numeric)
  1244.         damage_string = value.abs.to_s
  1245.       else
  1246.         damage_string = value.to_s
  1247.       end
  1248.       bitmap = Bitmap.new(160, 48)
  1249.       bitmap.font.name = "Georgia"
  1250.       bitmap.font.size = 22
  1251.       bitmap.font.italic = true
  1252.       if value.is_a?(Numeric) and value <= 0
  1253.         bitmap.font.color.set(255, 255, 128)
  1254.       else
  1255.         bitmap.font.color.set(255, 255, 255)
  1256.       end
  1257.       bitmap.draw_text(1, 13, 160, 36, damage_string, 1)
  1258.       bitmap.draw_text(0, 12, 160, 36, damage_string, 1)
  1259.       if critical
  1260.         bitmap.font.color.set(0, 0, 0)
  1261.         bitmap.draw_text(1, 6, 160, 20, "Critical", 1)
  1262.         bitmap.font.color.set(255, 245, 155)
  1263.         bitmap.draw_text(0, 5, 160, 20, "Critical", 1)
  1264.       end
  1265.       @_damage_sprite = ::Sprite.new(self.viewport)
  1266.       @_damage_sprite.bitmap = bitmap
  1267.       @_damage_sprite.ox = 80
  1268.       @_damage_sprite.oy = 20
  1269.       @_damage_sprite.x = self.x
  1270.       @_damage_sprite.y = self.y - self.oy / 2 - 40
  1271.       @_damage_sprite.z += 99999
  1272.       @_damage_duration = 30
  1273.     end
  1274.     def show_text(string, size=16, color=0)
  1275.       dispose_damage
  1276.       damage_string = string
  1277.       if string.is_a?(Array)
  1278.         array = true
  1279.       else
  1280.         array = false
  1281.       end
  1282.       bitmap = Bitmap.new(160, 48)
  1283.       bitmap.font.name = "Georgia"
  1284.       bitmap.font.size = size
  1285.       bitmap.font.italic = true
  1286.       if array
  1287.         for i in 0..string.size
  1288.           next if damage_string[i] == nil
  1289.           bitmap.font.color.set(96, 96-20, 0) if color == 0
  1290.           bitmap.font.color.set(0, 0, 0) if color != 0
  1291.           bitmap.draw_text(-1, (12+(16*i)-1)-16, 160, 36, damage_string[i], 1)
  1292.           bitmap.draw_text(+1, (12+(16*i)-1)-16, 160, 36, damage_string[i], 1)
  1293.           bitmap.draw_text(-1, (12+(16*i)+1)-16, 160, 36, damage_string[i], 1)
  1294.           bitmap.draw_text(+1, (12+(16*i)+1)-16, 160, 36, damage_string[i], 1)
  1295.           bitmap.font.color.set(255, 245, 155) if color == 0
  1296.           bitmap.font.color.set(144, 199, 150) if color == 1
  1297.           bitmap.font.color.set(197, 147, 190)if color == 2
  1298.           bitmap.font.color.set(138, 204, 198)if color == 3
  1299.           bitmap.draw_text(0, (12+(16*i))-16, 160, 36, damage_string[i], 1)
  1300.         end
  1301.       else
  1302.         bitmap.font.color.set(96, 96-20, 0) if color == 0
  1303.         bitmap.font.color.set(0, 0, 0) if color != 0
  1304.         bitmap.draw_text(-1, 12-1, 160, 36, damage_string, 1)
  1305.         bitmap.draw_text(+1, 12-1, 160, 36, damage_string, 1)
  1306.         bitmap.draw_text(-1, 12+1, 160, 36, damage_string, 1)
  1307.         bitmap.draw_text(+1, 12+1, 160, 36, damage_string, 1)
  1308.         bitmap.font.color.set(255, 245, 155) if color == 0
  1309.         bitmap.font.color.set(144, 199, 150) if color == 1
  1310.         bitmap.font.color.set(197, 147, 190)if color == 2
  1311.         bitmap.font.color.set(138, 204, 198)if color == 3
  1312.         bitmap.draw_text(0, 12, 160, 36, damage_string, 1)
  1313.       end
  1314.       @_damage_sprite = ::Sprite.new(self.viewport)
  1315.       @_damage_sprite.bitmap = bitmap
  1316.       @_damage_sprite.ox = 80
  1317.       @_damage_sprite.oy = 20
  1318.       @_damage_sprite.x = self.x
  1319.       @_damage_sprite.y = self.y - self.oy / 2
  1320.       @_damage_sprite.z = 3000
  1321.       @_damage_duration = 30
  1322.     end
  1323.     def dispose_damage
  1324.     if @_damage_sprite != nil
  1325.       @_damage_sprite.dispose
  1326.       @_damage_sprite = nil
  1327.     end
  1328.   end
  1329. end

  1330. #------------------------------------------------------------------------------
  1331. # Spriteset Map
  1332. #------------------------------------------------------------------------------
  1333. class Spriteset_Map
  1334.   alias crissaegrim_abs_spmap_create_characters create_characters
  1335.   alias crissaegrim_abs_spmap_update update
  1336. def create_characters
  1337.         crissaegrim_abs_spmap_create_characters
  1338.         @character_sprites.push(Sprite_Character.new(@viewport1, $game_range))
  1339. end
  1340. def update
  1341.   crissaegrim_abs_spmap_update
  1342.   $game_range.update
  1343. end
  1344. end

  1345. #------------------------------------------------------------------------------
  1346. # Window Skill
  1347. #------------------------------------------------------------------------------
  1348. class Window_Skill < Window_Selectable
  1349.   alias crissaegrim_abs_wskill_initialize initialize
  1350.   def initialize(x, y, width, height, actor)
  1351.     crissaegrim_abs_wskill_initialize(x, y, width, height, actor)
  1352.     $wait_skill = 0
  1353.   end
  1354.   def update_help
  1355.     if $wait_skill <= 0
  1356.     @help_window.set_text(skill == nil ? "" : skill.description)
  1357.   else
  1358.     @help_window.set_text(skill == nil ? "" : "技能设置完毕!")
  1359.   end
  1360. end
  1361. end
  1362. class Scene_Skill
  1363.   alias crissaegrim_abs_sskill_start start
  1364.   alias crissaegrim_abs_sskill_update update
  1365.   alias crissaegrim_abs_sskill_update_skill_selection update_skill_selection
  1366.   def start
  1367.     crissaegrim_abs_sskill_start
  1368.     $wait_skill = 0
  1369.   end
  1370. def update
  1371.   crissaegrim_abs_sskill_update
  1372.   $wait_skill -= 1 if $wait_skill > 0
  1373. end
  1374. def update_skill_selection
  1375.   crissaegrim_abs_sskill_update_skill_selection
  1376.   for button in Crissaegrim_ABS::Skill_Button.keys
  1377.     if Input.trigger?(button)
  1378.       Sound.play_decision
  1379.       Crissaegrim_ABS::Skill_Button[button] = @skill_window.skill.id
  1380.       $wait_skill = 100
  1381.     end
  1382.   end
  1383. end
  1384. end

  1385. #------------------------------------------------------------------------------
  1386. # Window Item
  1387. #------------------------------------------------------------------------------
  1388. class Window_Item < Window_Selectable
  1389.   alias crissaegrim_abs_witem_initialize initialize
  1390.   def initialize(x, y, width, height)
  1391.     crissaegrim_abs_witem_initialize(x, y, width, height)
  1392.     $wait_item = 0
  1393.   end
  1394.   def update_help
  1395.     if $wait_item <= 0
  1396.     @help_window.set_text(item == nil ? "" : item.description)
  1397.   else
  1398.     @help_window.set_text(item == nil ? "" : "物品设置完毕!")
  1399.   end
  1400. end
  1401. end
  1402. class Scene_Item
  1403.   alias crissaegrim_abs_sitem_start start
  1404.   alias crissaegrim_abs_sitem_update update
  1405.   alias crissaegrim_abs_sitem_update_item_selection update_item_selection
  1406. def start
  1407.   crissaegrim_abs_sitem_start
  1408.   $wait_item = 0
  1409. end
  1410. def update
  1411.   crissaegrim_abs_sitem_update
  1412.   $wait_item -= 1 if $wait_item > 0
  1413. end
  1414. def update_item_selection
  1415.   crissaegrim_abs_sitem_update_item_selection
  1416.   for button in Crissaegrim_ABS::Item_Button.keys
  1417.   if Input.trigger?(button)
  1418.   Sound.play_decision
  1419.   Crissaegrim_ABS::Item_Button[button] = @item_window.item.id
  1420.   $wait_item = 100
  1421. end
  1422. end
  1423. end
  1424. end

  1425. #------------------------------------------------------------------------------
  1426. # Scene Title
  1427. #------------------------------------------------------------------------------
  1428. class Scene_Title < Scene_Base
  1429.   alias crissaegrim_abs_stitle_command_new_game command_new_game
  1430.   def command_new_game
  1431.     $game_range = Game_Range.new
  1432.     crissaegrim_abs_stitle_command_new_game
  1433.   end
  1434. end

  1435. #------------------------------------------------------------------------------
  1436. # Fim do ABS
  1437. #------------------------------------------------------------------------------
复制代码
以及
  1. #==============================================================================
  2. # ■ 容错脚本第3版(070816修订)                                   BY 轮回者
  3. #------------------------------------------------------------------------------
  4. #  本脚本基于星大叔的容错脚本第2版,区别只是“下手”的地方不同而已。
  5. #  说明请参看星大叔的容错脚本第2版。
  6. #------------------------------------------------------------------------------
  7. #  07.08.16
  8. #     修正了按下F12重启后的错误
  9. #     附,出错原因:重启后RMXP封装的类没有重置
  10. #==============================================================================
  11. begin
  12.   result = Graphics::Transition.nil?
  13. rescue
  14.   result = true
  15. end

  16. if result
  17.   
  18.   $need_file_bitmap = []
  19.   if FileTest.exist?("log_bitmap.txt")
  20.     f = File.open("./log_bitmap.txt","r")
  21.     $need_file_bitmap = f.read.split(/\n/)
  22.     f.close
  23.   end

  24.   module Graphics
  25.     Transition = method("transition")
  26.     def self.transition(*arg)
  27.       begin
  28.         Transition.call(*arg)
  29.       rescue Errno::ENOENT
  30.         ary=[*arg]
  31.         filename=ary[1]
  32.         unless $need_file_bitmap.include?(filename)
  33.           $need_file_bitmap.push(filename)
  34.           f = File.open("./log_bitmap.txt","a")
  35.           f.write(filename + "\n")
  36.           f.close
  37.         end
  38.         Transition.call(ary[0])
  39.       end
  40.     end
  41.   end

  42.   class Bitmap < Object
  43.     alias ini_Fx initialize
  44.      
  45.     def initialize(*args)
  46.       begin
  47.         ini_Fx(*args)
  48.         return
  49.       rescue Errno::ENOENT
  50.         filename=[*args][0]
  51.         unless $need_file_bitmap.include?(filename)
  52.           $need_file_bitmap.push(filename)
  53.           f = File.open("./log_bitmap.txt","a")
  54.           f.write(filename + "\n")
  55.           f.close
  56.         end
  57.         ini_Fx(32,32)
  58.       end
  59.     end
  60.   end

  61.   $need_file_audio = []
  62.   if FileTest.exist?("log_audio.txt")
  63.     f = File.open("./log_audio.txt","r")
  64.     $need_file_audio = f.read.split(/\n/)
  65.     f.close
  66.   end
  67.   
  68.   module Audio
  69.     Me_play = method("me_play")
  70.     def self.me_play(*arg)
  71.       begin
  72.         Me_play.call(*arg)
  73.       rescue Errno::ENOENT
  74.         filename=[*arg][0]
  75.         unless $need_file_audio.include?(filename)
  76.           $need_file_audio.push(filename)
  77.           f = File.open("./log_audio.txt","a")
  78.           f.write(filename + "\n")
  79.           f.close
  80.         end
  81.         me_stop
  82.       end
  83.     end
  84.     Bgm_play = method("bgm_play")
  85.     def self.bgm_play(*arg)
  86.       begin
  87.         Bgm_play.call(*arg)
  88.       rescue Errno::ENOENT
  89.         filename=[*arg][0]
  90.         unless $need_file_audio.include?(filename)
  91.           $need_file_audio.push(filename)
  92.           f = File.open("./log_audio.txt","a")
  93.           f.write(filename + "\n")
  94.           f.close
  95.         end
  96.         bgm_stop
  97.       end
  98.     end
  99.     Se_play = method("se_play")
  100.     def self.se_play(*arg)
  101.       begin
  102.         Se_play.call(*arg)
  103.       rescue Errno::ENOENT
  104.         filename=[*arg][0]
  105.         unless $need_file_audio.include?(filename)
  106.           $need_file_audio.push(filename)
  107.           f = File.open("./log_audio.txt","a")
  108.           f.write(filename + "\n")
  109.           f.close
  110.         end
  111.         se_stop
  112.       end
  113.     end
  114.     Bgs_play = method("bgs_play")
  115.     def self.bgs_play(*arg)
  116.       begin
  117.         Bgs_play.call(*arg)
  118.       rescue Errno::ENOENT
  119.         filename=[*arg][0]
  120.         unless $need_file_audio.include?(filename)
  121.           $need_file_audio.push(filename)
  122.           f = File.open("./log_audio.txt","a")
  123.           f.write(filename + "\n")
  124.           f.close
  125.         end
  126.         bgs_stop
  127.       end
  128.     end
  129.   end
  130. end
复制代码
以及
  1. #==============================================================================
  2. # ■ 容错脚本第3版(070816修订)                                   BY 轮回者
  3. #------------------------------------------------------------------------------
  4. #  本脚本基于星大叔的容错脚本第2版,区别只是“下手”的地方不同而已。
  5. #  说明请参看星大叔的容错脚本第2版。
  6. #------------------------------------------------------------------------------
  7. #  07.08.16
  8. #     修正了按下F12重启后的错误
  9. #     附,出错原因:重启后RMXP封装的类没有重置
  10. #==============================================================================
  11. begin
  12.   result = Graphics::Transition.nil?
  13. rescue
  14.   result = true
  15. end

  16. if result
  17.   
  18.   $need_file_bitmap = []
  19.   if FileTest.exist?("log_bitmap.txt")
  20.     f = File.open("./log_bitmap.txt","r")
  21.     $need_file_bitmap = f.read.split(/\n/)
  22.     f.close
  23.   end

  24.   module Graphics
  25.     Transition = method("transition")
  26.     def self.transition(*arg)
  27.       begin
  28.         Transition.call(*arg)
  29.       rescue Errno::ENOENT
  30.         ary=[*arg]
  31.         filename=ary[1]
  32.         unless $need_file_bitmap.include?(filename)
  33.           $need_file_bitmap.push(filename)
  34.           f = File.open("./log_bitmap.txt","a")
  35.           f.write(filename + "\n")
  36.           f.close
  37.         end
  38.         Transition.call(ary[0])
  39.       end
  40.     end
  41.   end

  42.   class Bitmap < Object
  43.     alias ini_Fx initialize
  44.      
  45.     def initialize(*args)
  46.       begin
  47.         ini_Fx(*args)
  48.         return
  49.       rescue Errno::ENOENT
  50.         filename=[*args][0]
  51.         unless $need_file_bitmap.include?(filename)
  52.           $need_file_bitmap.push(filename)
  53.           f = File.open("./log_bitmap.txt","a")
  54.           f.write(filename + "\n")
  55.           f.close
  56.         end
  57.         ini_Fx(32,32)
  58.       end
  59.     end
  60.   end

  61.   $need_file_audio = []
  62.   if FileTest.exist?("log_audio.txt")
  63.     f = File.open("./log_audio.txt","r")
  64.     $need_file_audio = f.read.split(/\n/)
  65.     f.close
  66.   end
  67.   
  68.   module Audio
  69.     Me_play = method("me_play")
  70.     def self.me_play(*arg)
  71.       begin
  72.         Me_play.call(*arg)
  73.       rescue Errno::ENOENT
  74.         filename=[*arg][0]
  75.         unless $need_file_audio.include?(filename)
  76.           $need_file_audio.push(filename)
  77.           f = File.open("./log_audio.txt","a")
  78.           f.write(filename + "\n")
  79.           f.close
  80.         end
  81.         me_stop
  82.       end
  83.     end
  84.     Bgm_play = method("bgm_play")
  85.     def self.bgm_play(*arg)
  86.       begin
  87.         Bgm_play.call(*arg)
  88.       rescue Errno::ENOENT
  89.         filename=[*arg][0]
  90.         unless $need_file_audio.include?(filename)
  91.           $need_file_audio.push(filename)
  92.           f = File.open("./log_audio.txt","a")
  93.           f.write(filename + "\n")
  94.           f.close
  95.         end
  96.         bgm_stop
  97.       end
  98.     end
  99.     Se_play = method("se_play")
  100.     def self.se_play(*arg)
  101.       begin
  102.         Se_play.call(*arg)
  103.       rescue Errno::ENOENT
  104.         filename=[*arg][0]
  105.         unless $need_file_audio.include?(filename)
  106.           $need_file_audio.push(filename)
  107.           f = File.open("./log_audio.txt","a")
  108.           f.write(filename + "\n")
  109.           f.close
  110.         end
  111.         se_stop
  112.       end
  113.     end
  114.     Bgs_play = method("bgs_play")
  115.     def self.bgs_play(*arg)
  116.       begin
  117.         Bgs_play.call(*arg)
  118.       rescue Errno::ENOENT
  119.         filename=[*arg][0]
  120.         unless $need_file_audio.include?(filename)
  121.           $need_file_audio.push(filename)
  122.           f = File.open("./log_audio.txt","a")
  123.           f.write(filename + "\n")
  124.           f.close
  125.         end
  126.         bgs_stop
  127.       end
  128.     end
  129.   end
  130. end
复制代码
最后是
  1. #==============================================================================
  2. # ** Scene_File
  3. #------------------------------------------------------------------------------
  4. #  This class performs the save and load screen processing.
  5. #==============================================================================

  6. class Scene_File < Scene_Base

  7.   #--------------------------------------------------------------------------
  8.   # * Write Save Data
  9.   #     file : write file object (opened)
  10.   #--------------------------------------------------------------------------
  11.   def write_save_data(file)
  12.     characters = []
  13.     for actor in $game_party.members
  14.       characters.push([actor.character_name, actor.character_index])
  15.     end
  16.     $game_system.save_count += 1
  17.     $game_system.version_id = $data_system.version_id
  18.     @last_bgm = RPG::BGM::last
  19.     @last_bgs = RPG::BGS::last
  20.     Marshal.dump(characters,           file)
  21.     Marshal.dump(Graphics.frame_count, file)
  22.     Marshal.dump(@last_bgm,            file)
  23.     Marshal.dump(@last_bgs,            file)
  24.     Marshal.dump($game_system,         file)
  25.     Marshal.dump($game_message,        file)
  26.     Marshal.dump($game_switches,       file)
  27.     Marshal.dump($game_variables,      file)
  28.     Marshal.dump($game_self_switches,  file)
  29.     Marshal.dump($game_actors,         file)
  30.     Marshal.dump($game_party,          file)
  31.     Marshal.dump($game_troop,          file)
  32.     Marshal.dump($game_map,            file)
  33.     Marshal.dump($game_player,         file)
  34.     Marshal.dump($game_range,          file)
  35.    
  36.   end
  37.   #--------------------------------------------------------------------------
  38.   # * Read Save Data
  39.   #     file : file object for reading (opened)
  40.   #--------------------------------------------------------------------------
  41.   def read_save_data(file)
  42.     characters           = Marshal.load(file)
  43.     Graphics.frame_count = Marshal.load(file)
  44.     @last_bgm            = Marshal.load(file)
  45.     @last_bgs            = Marshal.load(file)
  46.     $game_system         = Marshal.load(file)
  47.     $game_message        = Marshal.load(file)
  48.     $game_switches       = Marshal.load(file)
  49.     $game_variables      = Marshal.load(file)
  50.     $game_self_switches  = Marshal.load(file)
  51.     $game_actors         = Marshal.load(file)
  52.     $game_party          = Marshal.load(file)
  53.     $game_troop          = Marshal.load(file)
  54.     $game_map            = Marshal.load(file)
  55.     $game_player         = Marshal.load(file)
  56.     $game_range          = Marshal.load(file)
  57.     if $game_system.version_id != $data_system.version_id
  58.       $game_map.setup($game_map.map_id)
  59.       $game_player.center($game_player.x, $game_player.y)
  60.     end
  61.   end
  62. end
复制代码
谢谢了!
您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

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

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

GMT+8, 2024-12-23 08:00

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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