Project1
标题:
请教一个ARPG脚本攻击范围的设定方法
[打印本页]
作者:
iTD
时间:
2011-7-5 14:28
标题:
请教一个ARPG脚本攻击范围的设定方法
本帖最后由 fux2 于 2011-7-5 14:51 编辑
想知道哪里是定义炸弹范围、炸弹时间、炸弹威力····
谢谢!!
脚本内容
:
#--------------------------------------------------------------------------
# ● 定义ARPG
#--------------------------------------------------------------------------
class ARPG_zhadan
#--------------------------------------------------------------------------
# ● 初始化对象
#--------------------------------------------------------------------------
def initialize
@zhadan_ID = $game_variables[152]
@zhadan_x = $game_map.events[$game_variables[152]].x
@zhadan_y = $game_map.events[$game_variables[152]].y
update
end
#--------------------------------------------------------------------------
# ● 更新数值变化
#--------------------------------------------------------------------------
def refresh(type)
case type
when 0
if $game_switches[21] == true
if (@zhadan_x - $game_player.x).abs <=10
if (@zhadan_y - $game_player.y).abs <=10
if Input.trigger?(Input::UP)
$game_map.events[$game_variables[152]].move_up
end
if Input.trigger?(Input::DOWN)
$game_map.events[$game_variables[152]].move_down
end
if Input.trigger?(Input::RIGHT)
$game_map.events[$game_variables[152]].move_right
end
if Input.trigger?(Input::LEFT)
$game_map.events[$game_variables[152]].move_left
end
if Input.trigger?(Input::C)
x = $game_map.events[$game_variables[152]].x - $game_map.events[$game_variables[151]].x
y = $game_map.events[$game_variables[152]].y - $game_map.events[$game_variables[151]].y
$game_map.events[$game_variables[151]].jump(x,y)
$game_switches[22] = true
end
return
else
$game_map.events[$game_variables[152]].move_backward
end
else
$game_map.events[$game_variables[152]].move_backward
end
end
end
end
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def update
@zhadan_x = $game_map.events[$game_variables[152]].x
@zhadan_y = $game_map.events[$game_variables[152]].y
refresh(0)
end
end
#--------------------------------------------------------------------------
# ● 定义ARPG
#--------------------------------------------------------------------------
class ARPG_zhadan2
#--------------------------------------------------------------------------
# ● 初始化对象
#--------------------------------------------------------------------------
def initialize
@zhadan2_ID = $game_variables[151]
@zhadan2_x = $game_map.events[$game_variables[151]].x
@zhadan2_y = $game_map.events[$game_variables[151]].y
update
end
#--------------------------------------------------------------------------
# ● 更新数值变化
#--------------------------------------------------------------------------
def refresh(type)
case type
when 0
$n2 = 0
$game_map.events[$game_variables[151]].animation_id =7
while $n2 <= $game_variables[123]
$n2 += 1
if $game_variables[200+$n2] >= 0
if ($game_map.events[$n2].x - @zhadan2_x).abs <= 3
if ($game_map.events[$n2].y - @zhadan2_y).abs <= 3
$攻击1=$game_actors[1].str * 4
$攻击1 /= 2
$攻击3 = $攻击1
$攻击3 +=$game_actors[1].atk
$攻击3 -= rand(10)
$攻击3 += rand(10)
$game_map.events[$n2].damage=$攻击3
$game_map.events[$n2].damage_pop = true
$game_variables[200+$n2] -= $攻击3
Audio.se_play("Audio/SE/052-Cannon01",90,100)
end
end
end
end
if ($game_player.x - @zhadan2_x).abs <= 3
if ($game_player.y - @zhadan2_y).abs <= 3
$攻击1=$game_actors[1].str * 4
$攻击1 /= 2
$攻击3 = $攻击1
$攻击3 +=$game_actors[1].atk
$攻击3 -= rand(10)
$攻击3 += rand(10)
$game_player.damage= $攻击3
$game_player.damage_pop = true
$game_actors[1].hp -= $攻击3
Audio.se_play("Audio/SE/052-Cannon01",90,100)
$game_switches[24] = true
end
end
end
end
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def update
@zhadan2_x = $game_map.events[$game_variables[151]].x
@zhadan2_y = $game_map.events[$game_variables[151]].y
refresh(0)
end
end
复制代码