theabsoluteone
Member
For my ABS I am using the following small script to delete dead enemies,
however, whenever I kill the first enemies, all other enemies die after one hit.
Can anyone help me with this?
Thanks in advanced!
however, whenever I kill the first enemies, all other enemies die after one hit.
Can anyone help me with this?
Code:
if Input.trigger?(Input::C)
hero_attack
enemy_x = @x + (@direction == 6 ? 1 : @direction == 4 ? -1 : 0)
enemy_y = @y + (@direction == 2 ? 1 : @direction == 8 ? -1 : 0)
for event in $game_map.events.values
if event.x == enemy_x and event.y == enemy_y
target = $game_troop.smooth_target_enemy(event.id - 1)
troop = $data_troops[$game_temp.battle_troop_id]
@enemy_id = troop.members[event.id - 1].enemy_id
enemy = $game_troop.enemies[@enemy_id]
if enemy.hp == 0
$game_map.events[event.id].erase
else
target.attack_effect($game_actors[0])
end
end
end
end