class Game_Event def return_erased2 return @erased2 end def erase2 @erased2 = true end end class ARPG def skill return @skill end end #============================================================================== $wait_H = 0 $wait_H2 = 0 $普通攻击动画ID = 0 #============================================================================== class Scene_Map alias update_olc update def update update_olc @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] != "敌人" #敌人的攻击力: @enemy_attack = enemy.list[6].parameters[0].to_i @enemy_animation = enemy.list[9].parameters[0].to_i #敌人面向下,攻击角色 $wait_H += 0.1 if $game_player.x == enemy.x and $game_player.y - enemy.y == 1 and enemy.direction == 2 if $wait_H >= 200 case rand(40) when 2 enemy.animation_id = @enemy_animation if @ppp.pdef >= @enemy_attack #当敌人攻击少于角色防御 $game_switches[31] = true #显示MISS $game_player.damage_pop = true Mess_Text.write ("#{@ppp.name}没有受到伤害。") $wait_H += 0 else $game_player.damage = @enemy_attack - @ppp.pdef $game_player.damage_pop = true @ppp.hp -= $game_player.damage Mess_Text.write ("#{@ppp.name}受到#{$game_player.damage.to_i}点伤害。") $wait_H += 0 end #if end #if end #case end #if #敌人面向左,攻击角色 if $game_player.x - enemy.x == -1 and $game_player.y == enemy.y and enemy.direction == 4 if $wait_H >= 200 case rand(40) when 2 enemy.animation_id = @enemy_animation + 1 if @ppp.pdef >= @enemy_attack #当敌人攻击少于角色防御 $game_switches[31] = true #显示MISS $game_player.damage_pop = true Mess_Text.write ("#{@ppp.name}没有受到伤害。") $wait_H += 0 else $game_player.damage = @enemy_attack - @ppp.pdef $game_player.damage_pop = true @ppp.hp -= $game_player.damage Mess_Text.write ("#{@ppp.name}受到#{$game_player.damage.to_i}点伤害。") $wait_H += 0 end #if end #if end #case end #if #敌人面向右,攻击角色 if $game_player.x - enemy.x == 1 and $game_player.y == enemy.y and enemy.direction == 6 if $wait_H >= 200 case rand(40) when 2 enemy.animation_id = @enemy_animation + 2 if @ppp.pdef >= @enemy_attack #当敌人攻击少于角色防御 $game_switches[31] = true #显示MISS $game_player.damage_pop = true Mess_Text.write ("#{@ppp.name}没有受到伤害。") $wait_H += 0 else $game_player.damage = @enemy_attack - @ppp.pdef $game_player.damage_pop = true @ppp.hp -= $game_player.damage Mess_Text.write ("#{@ppp.name}受到#{$game_player.damage.to_i}点伤害。") $wait_H += 0 end #if end #if end #case end #if #敌人面向上,攻击角色 if $game_player.x == enemy.x and $game_player.y - enemy.y == -1 and enemy.direction == 8 if $wait_H >= 200 case rand(40) when 2 enemy.animation_id = @enemy_animation + 3 if @ppp.pdef >= @enemy_attack #当敌人攻击少于角色防御 $game_switches[31] = true #显示MISS $game_player.damage_pop = true Mess_Text.write ("#{@ppp.name}没有受到伤害。") $wait_H += 0 else $game_player.damage = @enemy_attack - @ppp.pdef $game_player.damage_pop = true @ppp.hp -= $game_player.damage Mess_Text.write ("#{@ppp.name}受到#{$game_player.damage.to_i}点伤害。") $wait_H += 0 end #if end #if end #case end #if #★★★★ end#for★ #-------------------------------------------------------------------------- # ● 定义旋舞斩 #-------------------------------------------------------------------------- def skill_旋舞斩 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] != "敌人" px = $game_player.x py = $game_player.y if (px - enemy.x).abs <= 2 and (py - enemy.y).abs <= 1 case rand(10) when 0..8 enemy.damage = $data_skills[@skill.id].power enemy.damage_pop = true case $game_player.direction when 2 enemy.jump(0, 1) when 4 enemy.jump(-1, 0) when 6 enemy.jump(1, 0) when 8 enemy.jump(0, -1) end when 9 enemy.damage = $data_skills[@skill.id].power*2 enemy.damage_pop = true enemy.critical = true case $game_player.direction when 2 enemy.jump(0, 1) when 4 enemy.jump(-1, 0) when 6 enemy.jump(1, 0) when 8 enemy.jump(0, -1) end end Mess_Text.write ("#{enemy.list[2].parameters[0]}受到#{enemy.damage.to_i}伤害。") end #伤害范围 end #定义event end #旋舞斩技能
a45bf90b17a1188e318975be4fd779d.png (29.85 KB, 下载次数: 17)
八个方向
446aa9f09be81bf5de9ab314171cd83.png (4.24 KB, 下载次数: 21)
技能范围扩大
soulsaga 发表于 2022-9-22 20:22
243行就是范围
真·可乐 发表于 2022-9-22 19:31
这是你自己写的arpg系统,还是用的别人的,只从中截一小段出来很难读懂啊。 ...
欢迎光临 Project1 (https://rpg.blue/) | Powered by Discuz! X3.1 |