@Christopho
I've got a compiled version and have not had this issue how long does it have to be running?
I've got a compiled version and have not had this issue how long does it have to be running?
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Show posts Menu
local enemy = ...
local game = enemy:get_game()
local map = enemy:get_map()
local hero = map:get_hero()
local sprite = enemy:create_sprite("enemies/Redead2")
local movement
local IsPlayerFrozen = false
function enemy:on_created()
movement = sol.movement.create("target")
enemy:set_life(8)
enemy:set_damage(10)
end
function enemy:on_restarted()
sol.timer.start(self, 3000, function() sol.audio.play_sound("Redead/RedeadMoan") end)
self:get_sprite():set_animation("immobilized")
enemy:check_hero()
end
function enemy:check_hero()
if self:get_distance(hero) <= 80 then
movement = sol.movement.create("target")
self:get_sprite():set_animation("walking")
movement:set_speed(28)
movement:start(enemy)
end
sol.timer.start(self, 1000, function() self:check_hero() end)
if self:get_distance(hero) <= 80 then
if IsPlayerFrozen == false then
sol.timer.start(self, 3000, function() hero:freeze() end)
IsPlayerFrozen = true
end
end
if self:get_distance(hero) <= 80 then
if IsPlayerFrozen == true then
sol.timer.start(self, 5000, function() hero:unfreeze() end)
IsPlayerFrozen = false
end
end
end
function enemy:on_dying()
sol.audio.play_sound("Redead/RedeadDie")
end
local enemy = ...
local game = enemy:get_game()
local map = enemy:get_map()
local hero = map:get_hero()
local sprite = enemy:create_sprite("enemies/Redead2")
local movement
local IsPlayerFrozen = false
function enemy:on_created()
movement = sol.movement.create("target")
enemy:set_life(8)
enemy:set_damage(10)
end
function enemy:on_restarted()
sol.timer.start(self, 3000, function() sol.audio.play_sound("Redead/RedeadMoan") end)
self:get_sprite():set_animation("immobilized")
enemy:check_hero()
if self:get_distance(hero) <= 80 then
if IsPlayerFrozen == false then
sol.timer.start(self, 3000, function() hero:freeze() end)
IsPlayerFrozen = true
sol.audio.play_sound("Redead/RedeadScream")
end
end
if self:get_distance(hero) <= 80 then
if IsPlayerFrozen == true then
sol.timer.start(self, 5000, function() hero:unfreeze() end)
IsPlayerFrozen = false
end
end
end
function enemy:check_hero()
if self:get_distance(hero) <= 80 then
movement = sol.movement.create("target")
self:get_sprite():set_animation("walking")
movement:set_speed(28)
movement:start(enemy)
end
sol.timer.start(self, 1000, function() self:check_hero() end)
end
function enemy:on_dying()
sol.audio.play_sound("Redead/RedeadDie")
end
if game:get_value("Sleeping") == 2
then movement:set_target(hero)
then movement:set_target(hero)
then movement:set_target(hero)
end
if game:get_value("Sleeping") == 2
local enemy = ...
local game = enemy:get_game()
local map = enemy:get_map()
local hero = map:get_hero()
local sprite
local movement
local sprite = enemy:create_sprite("enemies/" .. enemy:get_breed())
-- Event called when the enemy is initialized.
function enemy:on_created()
if game:get_value("Sleeping") == nil
then game:set_value("Sleeping",1)
end
enemy:set_life(25)
enemy:set_damage(12)
enemy:get_damage()
self:set_pushed_back_when_hurt(false)
end
function enemy:get_damage()
enemy:set_hurt_style("monster")
self:set_animation("sleeping")
end
function enemy:on_hurt()
if game:get_value("Sleeping") == 1
then game:set_value("Sleeping",2)
end
sol.audio.play_sound("IronKnuckle/Iron_KnuckleHit")
sol.audio.play_music("MiniBossTheme")
end
function enemy:on_dead()
enemy:create_enemy{
name = "UnarmoredIronKnuckle",
breed = "IronKnuckle Early Unarmored",
}
sol.audio.play_sound("IronKnuckle/Iron_KnuckleLoseArmor")
end
function enemy:on_restarted()
if game:get_value("Sleeping") == 2
then movement = sol.movement.create("target")
end
if game:get_value("Sleeping") == 2
then movement:set_target(hero)
end
if game:get_value("Sleeping") == 2
then movement:set_speed(15)
end
if game:get_value("Sleeping") == 2
then movement:start(enemy)
end
if game:get_value("Sleeping") == 2
then sprite:set_animation("walking")
end
end