diff --git a/quant.ew/files/system/end_fight/end_fight.lua b/quant.ew/files/system/end_fight/end_fight.lua index 1eb5fc92..3a02e46e 100644 --- a/quant.ew/files/system/end_fight/end_fight.lua +++ b/quant.ew/files/system/end_fight/end_fight.lua @@ -2,45 +2,50 @@ local end_fight = {} local first = true local try_kill = -1 local wait_to_heal = false +local init = -1 -ModLuaFileAppend("data/entities/animals/boss_centipede/ending/sampo_start_ending_sequence.lua", "mods/quant.ew/files/system/end_fight/ending_sequence_append.lua") +ModTextFileSetContent("data/entities/animals/boss_centipede/ending/gold_effect.xml", "") function end_fight.on_world_update() if GameHasFlagRun("ending_game_completed") then - local exists = false - for peer_id, playerdata in pairs(ctx.players) do - if peer_id ~= ctx.my_id and not EntityHasTag(playerdata.entity, "ew_notplayer") then - exists = true - GenomeSetHerdId(playerdata.entity, "player_pvp") - end - end - if wait_to_heal and not EntityHasTag(ctx.my_player.entity, "ew_notplayer") then - async(function() - wait(1) - EntityInflictDamage(ctx.my_player.entity, 100000000, "DAMAGE_HEALING", "", "None", 0, 0, GameGetWorldStateEntity()) - end) - wait_to_heal = false - end - if first then + if init == -1 then if EntityHasTag(ctx.my_player.entity, "ew_notplayer") then + EntityInflictDamage(ctx.my_player.entity, 100000000, "DAMAGE_CURSE", "", "None", 0, 0, GameGetWorldStateEntity()) wait_to_heal = true else async(function() - wait(1) - EntityInflictDamage(ctx.my_player.entity, 100000000, "DAMAGE_HEALING", "", "None", 0, 0, GameGetWorldStateEntity()) + wait(3) + EntityInflictDamage(ctx.my_player.entity, -100000000, "DAMAGE_HEALING", "", "None", 0, 0, GameGetWorldStateEntity()) end) end GamePrintImportant("Fight for the spoils") first = false - elseif not exists then - if try_kill == GameGetFrameNum() then - local x, y = EntityGetTransform(ctx.my_player.entity) - EntityLoad("data/entities/animals/boss_centipede/ending/gold_effect.xml", x, y ) - elseif try_kill == -1 then - try_kill = GameGetFrameNum() + 180 + init = GameGetFrameNum() + 10 + elseif init < GameGetFrameNum() then + local exists = false + for peer_id, playerdata in pairs(ctx.players) do + if peer_id ~= ctx.my_id and not EntityHasTag(playerdata.entity, "ew_notplayer") then + exists = true + GenomeSetHerdId(playerdata.entity, "player_pvp") + end + end + if wait_to_heal and not EntityHasTag(ctx.my_player.entity, "ew_notplayer") then + async(function() + wait(3) + EntityInflictDamage(ctx.my_player.entity, -100000000, "DAMAGE_HEALING", "", "None", 0, 0, GameGetWorldStateEntity()) + end) + wait_to_heal = false + end + if not exists and not EntityHasTag(ctx.my_player.entity, "ew_notplayer") then + if try_kill == GameGetFrameNum() then + local x, y = EntityGetTransform(ctx.my_player.entity) + EntityLoad("mods/quant.ew/files/system/end_fight/gold_effect.xml", x, y ) + elseif try_kill == -1 then + try_kill = GameGetFrameNum() + 180 + end + else + try_kill = -1 end - else - try_kill = -1 end end end diff --git a/quant.ew/files/system/end_fight/ending_sequence_append.lua b/quant.ew/files/system/end_fight/ending_sequence_append.lua deleted file mode 100644 index 79f00ce5..00000000 --- a/quant.ew/files/system/end_fight/ending_sequence_append.lua +++ /dev/null @@ -1,6 +0,0 @@ -local loadentity = EntityLoad -function EntityLoad(filename, x, y) - if filename ~= "data/entities/animals/boss_centipede/ending/gold_effect.xml" then - loadentity(filename, x, y) - end -end \ No newline at end of file diff --git a/quant.ew/files/system/end_fight/gold_effect.xml b/quant.ew/files/system/end_fight/gold_effect.xml new file mode 100644 index 00000000..f324d627 --- /dev/null +++ b/quant.ew/files/system/end_fight/gold_effect.xml @@ -0,0 +1,115 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/quant.ew/files/system/notplayer_ai/notplayer_ai.lua b/quant.ew/files/system/notplayer_ai/notplayer_ai.lua index 6cc2801e..376dc737 100644 --- a/quant.ew/files/system/notplayer_ai/notplayer_ai.lua +++ b/quant.ew/files/system/notplayer_ai/notplayer_ai.lua @@ -488,7 +488,7 @@ local function choose_wand_actions() end dont_throw = false aim_at(t_x, t_y) - fire_wand(not last_did_hit and state.init_timer > 90)-- or has_water_potion) + fire_wand(not last_did_hit and state.init_timer > 90 and not do_kick)-- or has_water_potion) return end fire_wand(false)