mirror of
https://github.com/IntQuant/noita_entangled_worlds.git
synced 2025-10-19 15:13:16 +00:00
fix end fight scene, fix notplayer not shooting after throwing stuff again
This commit is contained in:
parent
85382536ae
commit
2b1a713c36
4 changed files with 147 additions and 33 deletions
|
@ -2,11 +2,26 @@ local end_fight = {}
|
||||||
local first = true
|
local first = true
|
||||||
local try_kill = -1
|
local try_kill = -1
|
||||||
local wait_to_heal = false
|
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", "<Entity/>")
|
||||||
|
|
||||||
function end_fight.on_world_update()
|
function end_fight.on_world_update()
|
||||||
if GameHasFlagRun("ending_game_completed") then
|
if GameHasFlagRun("ending_game_completed") 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(3)
|
||||||
|
EntityInflictDamage(ctx.my_player.entity, -100000000, "DAMAGE_HEALING", "", "None", 0, 0, GameGetWorldStateEntity())
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
GamePrintImportant("Fight for the spoils")
|
||||||
|
first = false
|
||||||
|
init = GameGetFrameNum() + 10
|
||||||
|
elseif init < GameGetFrameNum() then
|
||||||
local exists = false
|
local exists = false
|
||||||
for peer_id, playerdata in pairs(ctx.players) do
|
for peer_id, playerdata in pairs(ctx.players) do
|
||||||
if peer_id ~= ctx.my_id and not EntityHasTag(playerdata.entity, "ew_notplayer") then
|
if peer_id ~= ctx.my_id and not EntityHasTag(playerdata.entity, "ew_notplayer") then
|
||||||
|
@ -16,26 +31,15 @@ function end_fight.on_world_update()
|
||||||
end
|
end
|
||||||
if wait_to_heal and not EntityHasTag(ctx.my_player.entity, "ew_notplayer") then
|
if wait_to_heal and not EntityHasTag(ctx.my_player.entity, "ew_notplayer") then
|
||||||
async(function()
|
async(function()
|
||||||
wait(1)
|
wait(3)
|
||||||
EntityInflictDamage(ctx.my_player.entity, 100000000, "DAMAGE_HEALING", "", "None", 0, 0, GameGetWorldStateEntity())
|
EntityInflictDamage(ctx.my_player.entity, -100000000, "DAMAGE_HEALING", "", "None", 0, 0, GameGetWorldStateEntity())
|
||||||
end)
|
end)
|
||||||
wait_to_heal = false
|
wait_to_heal = false
|
||||||
end
|
end
|
||||||
if first then
|
if not exists and not EntityHasTag(ctx.my_player.entity, "ew_notplayer") then
|
||||||
if EntityHasTag(ctx.my_player.entity, "ew_notplayer") then
|
|
||||||
wait_to_heal = true
|
|
||||||
else
|
|
||||||
async(function()
|
|
||||||
wait(1)
|
|
||||||
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
|
if try_kill == GameGetFrameNum() then
|
||||||
local x, y = EntityGetTransform(ctx.my_player.entity)
|
local x, y = EntityGetTransform(ctx.my_player.entity)
|
||||||
EntityLoad("data/entities/animals/boss_centipede/ending/gold_effect.xml", x, y )
|
EntityLoad("mods/quant.ew/files/system/end_fight/gold_effect.xml", x, y )
|
||||||
elseif try_kill == -1 then
|
elseif try_kill == -1 then
|
||||||
try_kill = GameGetFrameNum() + 180
|
try_kill = GameGetFrameNum() + 180
|
||||||
end
|
end
|
||||||
|
@ -43,6 +47,7 @@ function end_fight.on_world_update()
|
||||||
try_kill = -1
|
try_kill = -1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
return end_fight
|
return end_fight
|
|
@ -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
|
|
115
quant.ew/files/system/end_fight/gold_effect.xml
Normal file
115
quant.ew/files/system/end_fight/gold_effect.xml
Normal file
|
@ -0,0 +1,115 @@
|
||||||
|
<Entity name="unknown" >
|
||||||
|
|
||||||
|
<ParticleEmitterComponent
|
||||||
|
emitted_material_name="spark_yellow"
|
||||||
|
gravity.y="0.0"
|
||||||
|
lifetime_min="5.5"
|
||||||
|
lifetime_max="25.5"
|
||||||
|
count_min="10"
|
||||||
|
count_max="20"
|
||||||
|
render_on_grid="1"
|
||||||
|
fade_based_on_lifetime="1"
|
||||||
|
area_circle_radius.max="256"
|
||||||
|
cosmetic_force_create="0"
|
||||||
|
airflow_force="0.5"
|
||||||
|
airflow_time="0.01"
|
||||||
|
airflow_scale="0.05"
|
||||||
|
attractor_force="2"
|
||||||
|
emission_interval_min_frames="1"
|
||||||
|
emission_interval_max_frames="1"
|
||||||
|
emit_cosmetic_particles="1"
|
||||||
|
is_emitting="1" >
|
||||||
|
</ParticleEmitterComponent>
|
||||||
|
|
||||||
|
<ParticleEmitterComponent
|
||||||
|
emitted_material_name="gold"
|
||||||
|
gravity.y="0.0"
|
||||||
|
lifetime_min="15.5"
|
||||||
|
lifetime_max="25.5"
|
||||||
|
count_min="1"
|
||||||
|
count_max="3"
|
||||||
|
render_on_grid="1"
|
||||||
|
fade_based_on_lifetime="1"
|
||||||
|
area_circle_radius.max="32"
|
||||||
|
cosmetic_force_create="0"
|
||||||
|
airflow_force="0.5"
|
||||||
|
airflow_time="0.01"
|
||||||
|
airflow_scale="0.05"
|
||||||
|
attractor_force="2"
|
||||||
|
emission_interval_min_frames="1"
|
||||||
|
emission_interval_max_frames="1"
|
||||||
|
emit_cosmetic_particles="1"
|
||||||
|
>
|
||||||
|
</ParticleEmitterComponent>
|
||||||
|
|
||||||
|
<VelocityComponent
|
||||||
|
gravity_y="0"
|
||||||
|
mass="0.1"
|
||||||
|
>
|
||||||
|
</VelocityComponent>
|
||||||
|
|
||||||
|
<HomingComponent
|
||||||
|
target_tag="prey"
|
||||||
|
homing_targeting_coeff="30"
|
||||||
|
detect_distance="800"
|
||||||
|
homing_velocity_multiplier="0.9"
|
||||||
|
>
|
||||||
|
</HomingComponent>
|
||||||
|
|
||||||
|
<ProjectileComponent
|
||||||
|
_enabled="1"
|
||||||
|
lob_min="1.0"
|
||||||
|
lob_max="1.0"
|
||||||
|
speed_min="80"
|
||||||
|
speed_max="80"
|
||||||
|
friction="0"
|
||||||
|
direction_random_rad="0"
|
||||||
|
on_death_explode="0"
|
||||||
|
on_death_gfx_leave_sprite="0"
|
||||||
|
on_lifetime_out_explode="0"
|
||||||
|
explosion_dont_damage_shooter="1"
|
||||||
|
on_collision_die="0"
|
||||||
|
lifetime="180"
|
||||||
|
damage="0"
|
||||||
|
velocity_sets_scale="0"
|
||||||
|
ragdoll_force_multiplier="0"
|
||||||
|
hit_particle_force_multiplier="0"
|
||||||
|
camera_shake_when_shot="0"
|
||||||
|
bounces_left="0"
|
||||||
|
muzzle_flash_file=""
|
||||||
|
shoot_light_flash_radius="1"
|
||||||
|
knockback_force="0"
|
||||||
|
>
|
||||||
|
<config_explosion
|
||||||
|
never_cache="1"
|
||||||
|
camera_shake="0"
|
||||||
|
explosion_radius="0"
|
||||||
|
explosion_sprite=""
|
||||||
|
explosion_sprite_lifetime="0"
|
||||||
|
create_cell_probability="0"
|
||||||
|
hole_destroy_liquid="0"
|
||||||
|
explosion_sprite_emissive="0"
|
||||||
|
explosion_sprite_additive="0"
|
||||||
|
hole_enabled="0"
|
||||||
|
ray_energy="0"
|
||||||
|
damage="0"
|
||||||
|
particle_effect="0"
|
||||||
|
damage_mortals="0"
|
||||||
|
physics_explosion_power.min="0"
|
||||||
|
physics_explosion_power.max="0"
|
||||||
|
physics_throw_enabled="0"
|
||||||
|
shake_vegetation="0"
|
||||||
|
sparks_enabled="0"
|
||||||
|
stains_enabled="0"
|
||||||
|
>
|
||||||
|
</config_explosion>
|
||||||
|
</ProjectileComponent>
|
||||||
|
|
||||||
|
<LuaComponent
|
||||||
|
execute_on_removed="1"
|
||||||
|
execute_every_n_frame="-1"
|
||||||
|
script_source_file="data/entities/animals/boss_centipede/ending/sampo_normal_ending.lua"
|
||||||
|
remove_after_executed="0">
|
||||||
|
</LuaComponent>
|
||||||
|
</Entity>
|
||||||
|
|
|
@ -488,7 +488,7 @@ local function choose_wand_actions()
|
||||||
end
|
end
|
||||||
dont_throw = false
|
dont_throw = false
|
||||||
aim_at(t_x, t_y)
|
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
|
return
|
||||||
end
|
end
|
||||||
fire_wand(false)
|
fire_wand(false)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue