赞 | 2 |
VIP | 19 |
好人卡 | 7 |
积分 | 0 |
经验 | 17420 |
最后登录 | 2015-6-3 |
在线时间 | 237 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 44
- 在线时间
- 237 小时
- 注册时间
- 2011-2-27
- 帖子
- 1008
|
本帖最后由 fux2 于 2011-6-11 18:35 编辑
对pudding 的ARPG范例大爱。。。。但是,这个世界上没有无BUG的游戏。。
所以。。。求求各位解决以下的问题。。。。
每次刷新老怪们和队友都。。。满血!?
一打开菜单,存档等等就这样。。。
还有:开关条件存在时就会出错。麻烦解决成有开关判定的怪!(如XX开关打开,怪才出现。)
顺便帮忙加个暴击
以下为我自己修改过的脚本:- #by pudding 由 囧灬王阳 修改
- #------------------------------------------------------------------------------
- # 地图显示生命和地图显示伤害。
- #==============================================================================
- class Sprite_Character < RPG::Sprite
- attr_accessor :character
- def initialize(viewport, character = nil)
- super(viewport)
- @character = character
- @hpspsprite = Sprite.new(viewport)
- @hpspsprite.bitmap = Bitmap.new(160, 480)
- @hpspsprite.z = 0
- #@hp = 0
- #@maxhp = 0
- @sp = $game_party.actors[0].sp
- @maxsp = $game_party.actors[0].maxsp
- @damage = 0
- @level = $game_party.actors[0].level
- @kill = $game_party.actors[0].int
- end #initialize
- #------------------------------------------------------------------------------
- # 刷新
- #------------------------------------------------------------------------------
- alias :old_update :update
- def update
- old_update
- event = $game_map.events[@character.id] if @character.id != 0
- if @character.id != 0 and (@character.return_erased2 or @character.list[0].code != 108 or @character.list[0].parameters[0] != "全部")
- @hpspsprite.bitmap.clear
-
- old_update
- return
- end
- #------------------------------------------------------------------------------
- #
- #------------------------------------------------------------------------------
- if @character.id == 0
- @hp = $game_party.actors[0].hp
- @maxhp = $game_party.actors[0].maxhp
- else
- @damage -= @character.damage if @character.id != 0 and @character.damage
- if @hp=0
- @hp = @character.list[4].parameters[0].to_i + @damage
- end
- @maxhp = @character.list[5].parameters[0].to_i
- @exp = @character.list[6].parameters[0].to_i
- end
- #------------------------------------------------------------------------------
- # 描绘敌人HP
- #------------------------------------------------------------------------------
- if @character.id != 0 and (@character.return_erased2 or @character.list[0].code != 108 or @character.list[2].parameters[0] != "特殊")
- #p2 = 21 * @hp/[@maxhp].max
- #@hpspsprite.bitmap.fill_rect(90,98,31,6,Color.new(0,0,0))
- #@hpspsprite.bitmap.fill_rect(99,99,21,4,Color.new(255,255,255))
- #@hpspsprite.bitmap.fill_rect(99,99,p2,4,Color.new(255,0,0))
- #@hpspsprite.bitmap.font.size = 7
- #@hpspsprite.bitmap.font.color.set(255, 255, 255)
- #@hpspsprite.bitmap.draw_text(0, 0, 190, 202, "HP", 1)
- else
- p2 = 21 * @hp/[@maxhp].max
- @hpspsprite.bitmap.fill_rect(90,98,31,6,Color.new(0,0,0))
- @hpspsprite.bitmap.fill_rect(99,99,21,4,Color.new(255,255,255))
- @hpspsprite.bitmap.fill_rect(99,99,p2,4,Color.new(0,255,0))
- @hpspsprite.bitmap.font.size = 7
- @hpspsprite.bitmap.font.color.set(255, 255, 255)
- @hpspsprite.bitmap.draw_text(0, 0, 190, 202, "HP", 1)
- end
- #------------------------------------------------------------------------------
- # 描绘角色HP
- #------------------------------------------------------------------------------
- if @character.id == 0
- p2 = 21 * @hp/[@maxhp].max
- @hpspsprite.bitmap.fill_rect(90,98,31,6,Color.new(0,0,0))
- @hpspsprite.bitmap.fill_rect(99,99,21,4,Color.new(255,255,255))
- @hpspsprite.bitmap.fill_rect(99,99,p2,4,Color.new(255,0,0))
- @hpspsprite.bitmap.font.size = 7
- @hpspsprite.bitmap.font.color.set(255, 255, 255)
- @hpspsprite.bitmap.draw_text(0, 0, 190, 202, "HP", 1)
- end
- #------------------------------------------------------------------------------
- # 敌人的名字显示
- #------------------------------------------------------------------------------
- if @character.id != 0 and @ccd == nil
- @ccd = 1
- @hpspsprite.bitmap.font.size = 12
- @hpspsprite.bitmap.font.color.set(0, 0, 0)
- @hpspsprite.bitmap.draw_text(-1, -1, 215, 220, "#{@character.name}", 1)
- @hpspsprite.bitmap.draw_text(+1, -1, 215, 220, "#{@character.name}", 1)
- @hpspsprite.bitmap.draw_text(-1, +1, 215, 220, "#{@character.name}", 1)
- @hpspsprite.bitmap.draw_text(+1, +1, 215, 220, "#{@character.name}", 1)
- if @character.return_erased2 or @character.list[0].code != 108 or @character.list[2].parameters[0] != "特殊"
- @hpspsprite.bitmap.font.color.set(255, 0, 0)
- else
- @hpspsprite.bitmap.font.color.set(0, 255, 0)
- end
- @hpspsprite.bitmap.draw_text(0, 0, 215, 220, "#{@character.name}", 1)
- end
- #------------------------------------------------------------------------------
- # 角色名字
- #------------------------------------------------------------------------------
- if @character.id == 0 and @kk == nil
- @kk = 1
- p3 = 21 * @sp/[@maxsp].max
- @hpspsprite.bitmap.fill_rect(90,104,31,5,Color.new(0,0,0))
- @hpspsprite.bitmap.fill_rect(99,104,21,4,Color.new(255,255,255))
- @hpspsprite.bitmap.fill_rect(99,104,p3,4,Color.new(0,135,255))
- @hpspsprite.bitmap.draw_text(0, 0, 190, 213, "SP", 1)
- @hpspsprite.bitmap.font.size = 12
- @hpspsprite.bitmap.font.color.set(0, 0, 0)
- @hpspsprite.bitmap.draw_text(-1, -1, 215, 230, "#{$game_party.actors[0].name}", 1)
- @hpspsprite.bitmap.draw_text(+1, -1, 215, 230, "#{$game_party.actors[0].name}", 1)
- @hpspsprite.bitmap.draw_text(-1, +1, 215, 230, "#{$game_party.actors[0].name}", 1)
- @hpspsprite.bitmap.draw_text(+1, +1, 215, 230, "#{$game_party.actors[0].name}", 1)
- @hpspsprite.bitmap.font.color.set(0, 170, 250)
- @hpspsprite.bitmap.draw_text(0, 0, 215, 230, "#{$game_party.actors[0].name}", 1)
- end
- #------------------------------------------------------------------------------
- # 描绘SP
- #------------------------------------------------------------------------------
- if @character.id == 0
- if @sp != $game_party.actors[0].sp
- @sp = $game_party.actors[0].sp
- @maxsp = $game_party.actors[0].maxsp
- p3 = 21 * @sp/[@maxsp].max
- @hpspsprite.bitmap.fill_rect(90,104,31,5,Color.new(0,0,0))
- @hpspsprite.bitmap.fill_rect(99,104,21,4,Color.new(255,255,255))
- @hpspsprite.bitmap.fill_rect(99,104,p3,4,Color.new(0,135,255))
- @hpspsprite.bitmap.draw_text(0, 0, 190, 213, "SP", 1)
- end
- #------------------------------------------------------------------------------
- # 显示名字和等级
- #------------------------------------------------------------------------------
- if @level != $game_party.actors[0].level
- @level = $game_party.actors[0].level
- @hpspsprite.bitmap.clear
- @hpspsprite.bitmap.font.size = 12
- @hpspsprite.bitmap.font.color.set(0, 0, 0)
- @hpspsprite.bitmap.draw_text(-1, -1, 215, 230, "Lv"+"#{$game_party.actors[0].level.to_i}"+" "+"#{$game_party.actors[0].name}", 1)
- @hpspsprite.bitmap.draw_text(+1, -1, 215, 230, "Lv"+"#{$game_party.actors[0].level.to_i}"+" "+"#{$game_party.actors[0].name}", 1)
- @hpspsprite.bitmap.draw_text(-1, +1, 215, 230, "Lv"+"#{$game_party.actors[0].level.to_i}"+" "+"#{$game_party.actors[0].name}", 1)
- @hpspsprite.bitmap.draw_text(+1, +1, 215, 230, "Lv"+"#{$game_party.actors[0].level.to_i}"+" "+"#{$game_party.actors[0].name}", 1)
- @hpspsprite.bitmap.font.color.set(0, 170, 250)
- @hpspsprite.bitmap.draw_text(0, 0, 215, 230, "Lv"+"#{$game_party.actors[0].level.to_i}"+" "+"#{$game_party.actors[0].name}", 1)
- end
- end
- #------------------------------------------------------------------------------
- # 设置坐标
- #------------------------------------------------------------------------------
- @hpspsprite.x = self.x-106
- @hpspsprite.y = self.y-98
- #------------------------------------------------------------------------------
- # 地图显示伤害一部分
- #------------------------------------------------------------------------------
- if @character.damage_pop
- damage(@character.damage, @character.critical)
- @character.damage = nil
- @character.critical = false
- @character.damage_pop = false
- end
- #------------------------------------------------------------------------------
- # 当敌人生命值小于0时。
- #------------------------------------------------------------------------------
- if @hp <= 0 and @character.id != 0 and [email protected]_erased2 and @character.list[0].code == 108 and @character.list[0].parameters[0] == "全部"
- @character.erase2
- end
- #------------------------------------------------------------------------------
- # 角色死亡设置
- #------------------------------------------------------------------------------
- if $game_party.actors[0].hp <= 1
- $scene = Scene_Gameover.new
- end
- #------------------------------------------------------------------------------
- # 敌人死亡设置
- #------------------------------------------------------------------------------
- if @character.id != 0 and @character.return_erased2 == true and @asd == nil
- @asd = 1
- $game_party.actors[0].exp += @exp
- # 生成独立开关键
- key = [$game_map.map_id, event.id, 'A']
- # 更改独立开关
- $game_self_switches[key] = true
- $game_map.need_refresh = true
- end
- end #update
- end#class
- #------------------------------------------------------------------------------
- #
- #------------------------------------------------------------------------------
- class Game_Event
- def return_erased2
- return @erased2
- end
- def erase2
- @erased2 = true
- end
- end
- class Game_Event < Game_Character
- #——————————————————————————————————————
- # 用来返回名称
- #——————————————————————————————————————
- def name
- return @event.name
- end
- def name=(newname)
- @event.name = newname
- end
- end
- #------------------------------------------------------------------------------
- #地图显示伤害一部分
- #------------------------------------------------------------------------------
- class Game_Character
- attr_writer :opacity
- attr_accessor :through
- attr_accessor :character_name
- attr_accessor :white_flash
- attr_accessor :damage_pop
- attr_accessor :damage
- attr_accessor :critical
- attr_accessor :move_speed
- alias carol3_66RPG_damage_pop_initialize initialize
- def initialize
- @damage_pop = false
- @damage = 0
- @critical = false
- @white_flash=false
- carol3_66RPG_damage_pop_initialize
- end
- end
- #------------------------------------------------------------------------------
- # 播放动画时,不能移动(角色)
- #==============================================================================
- class Game_Player
- attr_accessor :sprite
- alias hzhj_update update
- def update
- return if @sprite != nil and @sprite.effect?
- hzhj_update
- end
- end
- module RPG
- class Sprite < ::Sprite
- def effect?
- @_whiten_duration > 0 or
- @_appear_duration > 0 or
- @_escape_duration > 0 or
- @_collapse_duration > 0 or
- @_animation_duration > 0
- end
- end
- end
- class Sprite_Character < RPG::Sprite
- alias hzhj_initialize initialize
- def initialize(viewport, character = nil)
- hzhj_initialize(viewport, character)
- if @character.class == Game_Player
- @character.sprite = self
- end
- end
- end
- #------------------------------------------------------------------------------
- # 处理地图画面的类。
- #------------------------------------------------------------------------------
- $enemy_S = 0
- $friend_S = 0
- #------------------------------------------------------------------------------
- class Scene_Map
- alias update_kc update
- def update
- update_kc
- @ppp = $game_party.actors[0]
- #〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓
- #▲△▲▲△▲▲△▲▲△▲▲△★ 敌人攻击 ★△▲▲△▲▲△▲▲△▲▲△▲▲△▲
- #〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓
- for enemy in $game_map.events.values
- next if enemy.return_erased2
- next if enemy.list == nil
- next if enemy.list[0].code != 108
- next if enemy.list[1].parameters[0] != "敌人"
- for friend in $game_map.events.values
- next if friend.return_erased2
- next if friend.list == nil
- next if friend.list[0].code != 108
- next if friend.list[1].parameters[0] != "队友"
- #--------------------------设置注释----------------------------------------------
- #敌人的攻击力
- @enemy_attack = enemy.list[7].parameters[0].to_i
- #敌人物理防御
- @enemy_pdef = enemy.list[8].parameters[0].to_i
- #敌人显示的动画
- @enemy_animation = enemy.list[9].parameters[0].to_i
- #敌人攻击速度
- @enemy_S = enemy.list[10].parameters[0].to_i
- #敌人攻击范围1
- @enemy_h = enemy.list[11].parameters[0].to_i
- #敌人攻击范围2
- @enemy_h2 = enemy.list[12].parameters[0].to_i
- #敌人挨打动画(很费)
- @enemy_p = enemy.list[13].parameters[0].to_i
- #------------------------------------------------------------------------------
- #角色的攻击
- @ppp_attack = @ppp.atk/2 + @ppp.str
- #角色的攻击减去敌人的防御
- @ppp_damage = @ppp_attack - @enemy_pdef.to_i
- #普通箭的伤害
- @arrow_damage = (@ppp_damage + @ppp.dex) * @ppp.agi
- #技能箭的伤害
- @arrow_skill_damage = ((@ppp_damage + @ppp.dex + @ppp.int) * @ppp.agi) *2
- #------------------------------------------------------------------------------
- #队友的攻击力
- @friend_attack = friend.list[7].parameters[0].to_i
- #队友的防御力
- @friend_pdef = friend.list[8].parameters[0].to_i
- #队友显示的动画
- @friend_animation_id = friend.list[9].parameters[0].to_i
- #队友攻击速度
- @friend_S = friend.list[10].parameters[0].to_i
- #队友攻击范围1
- @friend_h= friend.list[11].parameters[0].to_i
- #队友攻击范围2
- @friend_h2= friend.list[12].parameters[0].to_i
- #队友挨打动画(很费)
- @friend_p= friend.list[13].parameters[0].to_i
- #------------------------------------------------------------------------------
- # △敌人面向下,设置攻击△ (队友)
- #------------------------------------------------------------------------------
- if friend.x == enemy.x and friend.y - enemy.y <= @enemy_h and friend.y - enemy.y>=0 and enemy.direction == 2
- $enemy_S += 1
- case rand(5) #减少攻击次数
- when 2
- if $enemy_S >= @enemy_S #延迟攻击速度
- enemy.animation_id = @enemy_animation
- if @friend_pdef >= @enemy_attack #当敌人攻击少于队友防御
- $game_switches[31] = true #显示MISS
- friend.damage_pop = true
- $enemy_S = 0
-
- else
- friend.damage = @enemy_attack - @friend_pdef
- friend.damage_pop = true
- $enemy_S = 0
- end #if
- end #if
- end #case
- end #if
- #------------------------------------------------------------------------------
- # △敌人面向左,设置攻击△(队友)
- #------------------------------------------------------------------------------
- if friend.x - enemy.x >= @enemy_h2 and friend.y == enemy.y and friend.x - enemy.x<=0 and enemy.direction == 4
- $enemy_S += 1
- case rand(5) #减少攻击次数
- when 2
- if $enemy_S >= @enemy_S #延迟攻击速度
- enemy.animation_id = @enemy_animation + 1
- if @friend_pdef >= @enemy_attack #当敌人攻击少于队友防御
- $game_switches[31] = true #显示MISS
- friend.damage_pop = true
- $enemy_S = 0
- else
- friend.damage = @enemy_attack - @friend_pdef
- friend.damage_pop = true
- $enemy_S = 0
-
- end #if
- end #if
- end #case
- end #if
- #------------------------------------------------------------------------------
- # △敌人面向右,设置攻击△(队友)
- #------------------------------------------------------------------------------
- if friend.x - enemy.x <= @enemy_h and friend.y == enemy.y and friend.x - enemy.x>=0 and enemy.direction == 6
- $enemy_S += 1
- case rand(5) #减少攻击次数
- when 2
- if $enemy_S >= @enemy_S #延迟攻击速度
- enemy.animation_id = @enemy_animation + 2
- if @friend_pdef >= @enemy_attack #当敌人攻击少于队友防御
- $game_switches[31] = true #显示MISS
- friend.damage_pop = true
- $enemy_S = 0
- else
- friend.damage = @enemy_attack - @friend_pdef
- friend.damage_pop = true
- $enemy_S = 0
- end #if
- end #if
- end #case
- end #if
- #------------------------------------------------------------------------------
- # △敌人面向上,设置攻击△(队友)
- #------------------------------------------------------------------------------
- if friend.x == enemy.x and friend.y - enemy.y >= @enemy_h2 and friend.y - enemy.y<=0 and enemy.direction == 8
- $enemy_S += 1
- case rand(5) #减少攻击次数
- when 2
- if $enemy_S >= @enemy_S #延迟攻击速度
- enemy.animation_id = @enemy_animation + 3
- if @friend_pdef >= @enemy_attack #当敌人攻击少于队友防御
- $game_switches[31] = true #显示MISS
- friend.damage_pop = true
- $enemy_S = 0
- else
- friend.damage = @enemy_attack - @friend_pdef
- friend.damage_pop = true
- $enemy_S = 0
- end #if
- end #if
- end #case
- end #if
- end #for
- end #for
- #------------------------------------------------------------------------------
- # ▲敌人面向下,设置攻击▲ (角色)
- #------------------------------------------------------------------------------
- for enemy in $game_map.events.values
- next if enemy.return_erased2
- next if enemy.list == nil
- next if enemy.list[0].code != 108
- next if enemy.list[1].parameters[0] != "敌人"
- if $game_player.x == enemy.x and $game_player.y - enemy.y <= @enemy_h and $game_player.y - enemy.y>=0 and enemy.direction == 2
- $enemy_S += 1
- case rand(5) #减少攻击次数
- when 2
- if $enemy_S >= @enemy_S #延迟攻击速度
- enemy.animation_id = @enemy_animation
- if @ppp.pdef >= @enemy_attack #当敌人攻击少于角色防御
- $game_switches[31] = true #显示MISS
- $game_player.damage_pop = true
- $enemy_S = 0
- else
- $game_player.damage = @enemy_attack - @ppp.pdef
- $game_player.damage_pop = true
- @ppp.hp -= $game_player.damage
- $enemy_S = 0
- end #if
- end #if
- end #case
- end #if
- #------------------------------------------------------------------------------
- # ▲敌人面向左,设置攻击▲ (角色)
- #------------------------------------------------------------------------------
- if $game_player.x - enemy.x >= @enemy_h2 and $game_player.x - enemy.x<=0 and $game_player.y == enemy.y and enemy.direction == 4
- $enemy_S += 1
- case rand(5) #减少攻击次数
- when 2
- if $enemy_S >= @enemy_S #延迟攻击速度
- enemy.animation_id = @enemy_animation + 1
- if @ppp.pdef >= @enemy_attack #当敌人攻击少于角色防御
- $game_switches[31] = true #显示MISS
- $game_player.damage_pop = true
- $enemy_S = 0
- else
- $game_player.damage = @enemy_attack - @ppp.pdef
- $game_player.damage_pop = true
- @ppp.hp -= $game_player.damage
- $enemy_S = 0
- end #if
- end #if
- end #case
- end #if
- #------------------------------------------------------------------------------
- # ▲敌人面向右,设置攻击▲ (角色)
- #------------------------------------------------------------------------------
- if $game_player.x - enemy.x <=@enemy_h and $game_player.x - enemy.x>=0 and$game_player.y == enemy.y and enemy.direction == 6
- $enemy_S += 1
- case rand(5) #减少攻击次数
- when 2
- if $enemy_S >= @enemy_S #延迟攻击速度
- enemy.animation_id = @enemy_animation + 2
- if @ppp.pdef >= @enemy_attack #当敌人攻击少于角色防御
- $game_switches[31] = true #显示MISS
- $game_player.damage_pop = true
- $enemy_S = 0
- else
- $game_player.damage = @enemy_attack - @ppp.pdef
- $game_player.damage_pop = true
- @ppp.hp -= $game_player.damage
- $enemy_S = 0
- end #if
- end #if
- end #case
- end #if
- #------------------------------------------------------------------------------
- # ▲敌人面向上,设置攻击▲ (角色)
- #------------------------------------------------------------------------------
- #角色
- if $game_player.x == enemy.x and $game_player.y - enemy.y >= @enemy_h2 and $game_player.y - enemy.y <=0 and enemy.direction == 8
- $enemy_S += 1
- case rand(5) #减少攻击次数
- when 2
- if $enemy_S >= @enemy_S #延迟攻击速度
- enemy.animation_id = @enemy_animation + 3
- if @ppp.pdef >= @enemy_attack #当敌人攻击少于角色防御
- $game_switches[31] = true #显示MISS
- $game_player.damage_pop = true
- $enemy_S = 0
- else
- $game_player.damage = @enemy_attack - @ppp.pdef
- $game_player.damage_pop = true
- @ppp.hp -= $game_player.damage
- $enemy_S = 0
-
- end #if
- end #if
- end #case
- end #if
- #-------
- end#for
- #〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓
- #▲△▲▲△▲▲△▲▲△▲▲△★ 角色攻击 ★△▲▲△▲▲△▲▲△▲▲△▲▲△▲
- #〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓
- $game_temp.common_event_id = 5
- if Input.trigger?(Input::Y) and $game_player.sprite.effect? == false
- $game_temp.common_event_id = 2
- case $game_player.direction
- when 2 #角色向面下的动画
- $game_player.animation_id = $game_variables[51]
- when 4 #角色向面左的动画
- $game_player.animation_id = $game_variables[52]
- when 6 #角色向面右的动画
- $game_player.animation_id = $game_variables[53]
- when 8 #角色向面上的动画
- $game_player.animation_id = $game_variables[54]
- end
- #------------------------------------------------------------------------------
- for event in $game_map.events.values
- next if event.return_erased2
- next if event.list == nil
- next if event.list[0].code != 108
- next if event.list[1].parameters[0] != "敌人"
- #------------------------------------------------------------------------------
- # ▲角色面向下,设置攻击▲
- #------------------------------------------------------------------------------
- if $game_player.x == event.x and event.y - $game_player.y <= $game_variables[80] and event.y - $game_player.y >=0 and $game_player.direction == 2
- event.animation_id = @enemy_p
- if @ppp_attack <= @enemy_pdef #当角色攻击小于敌人防御就显示Miss
- $game_switches[31] = true #显示MISS
- event.damage_pop = true
- else
- event.damage = @ppp_damage
- event.damage_pop = true
- end
- end
- #------------------------------------------------------------------------------
- # ▲角色面向左,设置攻击▲
- #------------------------------------------------------------------------------
- if $game_player.x - event.x <= $game_variables[80] and $game_player.x - event.x >=0 and event.y == $game_player.y and $game_player.direction == 4
- event.animation_id = @enemy_p
- if @ppp_attack <= @enemy_pdef #当角色攻击小于敌人防御就显示Miss
- $game_switches[31] = true #显示MISS
- event.damage_pop = true
- else
- event.damage = @ppp_damage
- event.damage_pop = true
- end
- end
- #------------------------------------------------------------------------------
- # ▲角色面向右,设置攻击▲
- #------------------------------------------------------------------------------
- if $game_player.x - event.x >= $game_variables[81] and $game_player.x - event.x <=0 and event.y == $game_player.y and $game_player.direction == 6
- event.animation_id = @enemy_p
- if @ppp_attack <= @enemy_pdef #当角色攻击小于敌人防御就显示Miss
- $game_switches[31] = true #显示MISS
- event.damage_pop = true
- else
- event.damage = @ppp_damage
- event.damage_pop = true
- end
- end
- #------------------------------------------------------------------------------
- # ▲角色面向上,设置攻击▲
- #------------------------------------------------------------------------------
- if $game_player.x == event.x and event.y - $game_player.y >= $game_variables[81] and event.y - $game_player.y <=0 and $game_player.direction == 8
- event.animation_id = @enemy_p
- if @ppp_attack <= @enemy_pdef #当角色攻击小于敌人防御就显示Miss
- $game_switches[31] = true #显示MISS
- event.damage_pop = true
- else
- event.damage = @ppp_damage
- event.damage_pop = true
- end
- end
- for event in $game_map.events.values
- next if event.return_erased2
- next if event.list == nil
- next if event.list[0].code != 108
- next if event.list[1].parameters[0] != "队友"
- #------------------------------------------------------------------------------
- # ################### ▲角色面向下,设置攻击▲
- #------------------------------------------------------------------------------
- if $game_player.x == event.x and event.y - $game_player.y <= $game_variables[80] and event.y - $game_player.y >=0 and $game_player.direction == 2
- event.animation_id = @friend_p
- if @ppp_attack <= @friend_pdef #当角色攻击小于敌人防御就显示Miss
- $game_switches[31] = true #显示MISS
- event.damage_pop = true
- else
- event.damage = @ppp_damage
- event.damage_pop = true
- end
- end
- #------------------------------------------------------------------------------
- # ▲角色面向左,设置攻击▲
- #------------------------------------------------------------------------------
- if $game_player.x - event.x <= $game_variables[80] and $game_player.x - event.x >=0 and event.y == $game_player.y and $game_player.direction == 4
- event.animation_id = @friend_p
- if @ppp_attack <= @friend_pdef #当角色攻击小于敌人防御就显示Miss
- $game_switches[31] = true #显示MISS
- event.damage_pop = true
- else
- event.damage = @ppp_damage
- event.damage_pop = true
- end
- end
- #------------------------------------------------------------------------------
- # ▲角色面向右,设置攻击▲
- #------------------------------------------------------------------------------
- if $game_player.x - event.x >= $game_variables[81] and $game_player.x - event.x <=0 and event.y == $game_player.y and $game_player.direction == 6
- event.animation_id = @friend_p
- if @ppp_attack <= @friend_pdef #当角色攻击小于敌人防御就显示Miss
- $game_switches[31] = true #显示MISS
- event.damage_pop = true
- else
- event.damage = @ppp_damage
- event.damage_pop = true
- end
- end
- #------------------------------------------------------------------------------
- # ▲角色面向上,设置攻击▲
- #------------------------------------------------------------------------------
- if $game_player.x == event.x and event.y - $game_player.y >= $game_variables[81] and event.y - $game_player.y <=0 and $game_player.direction == 8
- event.animation_id = @friend_p
- if @ppp_attack <= @enemy_pdef #当角色攻击小于敌人防御就显示Miss
- $game_switches[31] = true #显示MISS
- event.damage_pop = true
- $game_variables[56] -= 1
- else
- event.damage = @ppp_damage
- event.damage_pop = true
- end
- if @ppp_attack <= @friend_pdef #当角色攻击小于敌人防御就显示Miss
- $game_switches[31] = true #显示MISS
- event.damage_pop = true
- $game_variables[56] - 1
- end
- end
- #------
- end#for
- end#if
- end
- #〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓
- #▲△▲▲△▲▲△▲▲△▲▲△★ 队友攻击 ★△▲▲△▲▲△▲▲△▲▲△▲▲△▲
- #〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓
- for enemy in $game_map.events.values
- next if enemy.return_erased2
- next if enemy.list == nil
- next if enemy.list[0].code != 108
- next if enemy.list[1].parameters[0] != "敌人"
- for friend in $game_map.events.values
- next if friend.return_erased2
- next if friend.list == nil
- next if friend.list[0].code != 108
- next if friend.list[1].parameters[0] != "队友"
- #------------------------------------------------------------------------------
- # ▲队友面向下,设置攻击▲
- #------------------------------------------------------------------------------
- if friend.x == enemy.x and enemy.y - friend.y <= @friend_h and enemy.y - friend.y >=0 and friend.direction == 2
- $friend_S += 1
- case rand(5) #减少攻击次数
- when 2
- if $friend_S >= @friend_S #延迟攻击速度
- friend.animation_id = @friend_animation_id
- if @enemy_pdef >= @friend_attack #当队友攻击少于敌人防御
- $game_switches[31] = true #显示MISS
- enemy.damage_pop = true
- $friend_S = 0
-
- else
- enemy.damage = @friend_attack
- enemy.damage_pop = true
- enemy.jump(0,1)
- $friend_S = 0
- end #if
- end #if
- end #case
- end #if
- #------------------------------------------------------------------------------
- # ▲队友面向左,设置攻击▲
- #------------------------------------------------------------------------------
- if friend.x - enemy.x <= @friend_h and friend.x - enemy.x>=0 and enemy.y == friend.y and friend.direction == 4
- $friend_S += 1
- case rand(5) #减少攻击次数
- when 2
- if $friend_S >= @friend_S #延迟攻击速度
- friend.animation_id = @friend_animation_id + 1
- if @enemy_pdef >= @friend_attack #当队友攻击少于敌人防御
- $game_switches[31] = true #显示MISS
- enemy.damage_pop = true
- $friend_S = 0
-
- else
- enemy.damage = @friend_attack
- enemy.damage_pop = true
- enemy.jump(0,1)
- $friend_S = 0
-
- end #if
- end #if
- end #case
- end #if
- #------------------------------------------------------------------------------
- # ▲队友面向右,设置攻击▲
- #------------------------------------------------------------------------------
- if friend.x - enemy.x >= @friend_h2 and friend.x - enemy.x<=0 and enemy.y == friend.y and friend.direction == 6
- $friend_S += 1
- case rand(5) #减少攻击次数
- when 2
- if $friend_S >= @friend_S #延迟攻击速度
- friend.animation_id = @friend_animation_id + 2
- if @enemy_pdef >= @friend_attack #当队友攻击少于敌人防御
- $game_switches[31] = true #显示MISS
- enemy.damage_pop = true
- $friend_S = 0
-
- else
- enemy.damage = @friend_attack
- enemy.damage_pop = true
- enemy.jump(0,1)
- $friend_S = 0
-
- end #if
- end #if
- end #case
- end #if
- #------------------------------------------------------------------------------
- # ▲队友面向上,设置攻击▲
- #------------------------------------------------------------------------------
- if friend.x == enemy.x and enemy.y - friend.y >= @friend_h2 and enemy.y - friend.y<=0 and friend.direction == 8
- $friend_S += 1
- case rand(5) #减少攻击次数
- when 2
- if $friend_S >= @friend_S #延迟攻击速度
- friend.animation_id = @friend_animation_id + 3
- if @enemy_pdef >= @friend_attack #当队友攻击少于敌人防御
- $game_switches[31] = true #显示MISS
- enemy.damage_pop = true
- $friend_S = 0
-
- else
- enemy.damage = @friend_attack
- enemy.damage_pop = true
- enemy.jump(0,1)
- $friend_S = 0
-
- end #if
- end #if
- end #case
- end #if
- end#for
- end#for
- #------------------------------------------------------------------------------
- #普通箭的判断
- #------------------------------------------------------------------------------
- for arr in $game_map.events.values
- next if arr.return_erased2
- next if arr.list == nil
- next if arr.list[0].code != 108
- next if arr.list[0].parameters[0] != "箭"
- for event in $game_map.events.values
- next if event.return_erased2
- next if event.list == nil
- next if event.list[0].code != 108
- next if event.list[1].parameters[0] != "敌人"
- if arr.x == event.x and arr.y == event.y
- if @arrow_damage <= @enemy_pdef #当角色攻击小于敌人防御就显示Miss
- $game_switches[31] = true #显示MISS
- event.damage_pop = true
-
- else
- event.damage = @arrow_damage
- event.damage_pop = true
- arr.moveto(0,0)
- arr.opacity = 0
-
- end
- end
- end
- end
- #------------------------------------------------------------------------------
- #技能箭的判断
- #------------------------------------------------------------------------------
- for brr in $game_map.events.values
- next if brr.return_erased2
- next if brr.list == nil
- next if brr.list[0].code != 108
- next if brr.list[0].parameters[0] != "冰箭"
- for event in $game_map.events.values
- next if event.return_erased2
- next if event.list == nil
- next if event.list[0].code != 108
- next if event.list[1].parameters[0] != "敌人"
- if brr.x == event.x and brr.y == event.y
- if @arrow_skill_damage <= @enemy_pdef #当角色攻击小于敌人防御就显示Miss
- $game_switches[31] = true #显示MISS
- event.damage_pop = true
-
- else
- event.damage = @arrow_skill_damage
- event.damage_pop = true
- brr.moveto(0,0)
- brr.opacity = 0
-
- end
- end
- end
- end
- end#update
- #--------------------------------------------------------------------------
- # ● 物品炸弹
- #--------------------------------------------------------------------------
- def item_bomb
- for bomb in $game_map.events.values
- next if bomb.list == nil
- next if bomb.list[0].code != 108
- next if bomb.list[0].parameters[0] != "bomb"
- bomb.animation_id = 99
- for event in $game_map.events.values
- next if event.return_erased2
- next if event.list == nil
- next if event.list[0].code != 108
- next if event.list[1].parameters[0] != "敌人"
- if (bomb.x - event.x).abs <= 1 and (bomb.y - event.y).abs <= 2
- event.damage = (@ppp_attack + @ppp.int/2)*2 + 500
- event.damage_pop = true
- case $game_player.direction
- when 2
- event.jump(0, 1)
- when 4
- event.jump(-1, 0)
- when 6
- event.jump(1, 0)
- when 8
- event.jump(0, -1)
- end
- end
- end
- end
- end #def item_bomb
- end#class
复制代码 |
|