mirror of
https://github.com/IntQuant/noita_entangled_worlds.git
synced 2025-10-19 07:03:16 +00:00
hamis
This commit is contained in:
parent
889240bff9
commit
470425849f
5 changed files with 87 additions and 2 deletions
3
quant.ew/files/system/hamis/append.lua
Normal file
3
quant.ew/files/system/hamis/append.lua
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
function interacting(entity_who_interacted, entity_interacted, interactable_name)
|
||||||
|
CrossCall("ew_pet_hamis", entity_who_interacted, entity_interacted)
|
||||||
|
end
|
68
quant.ew/files/system/hamis/hamis.lua
Normal file
68
quant.ew/files/system/hamis/hamis.lua
Normal file
|
@ -0,0 +1,68 @@
|
||||||
|
dofile_once("data/scripts/lib/utilities.lua")
|
||||||
|
|
||||||
|
local rpc = net.new_rpc_namespace()
|
||||||
|
|
||||||
|
ModLuaFileAppend("data/scripts/animals/longleg_pet.lua", "mods/quant.ew/files/system/hamis/append.lua")
|
||||||
|
|
||||||
|
local function frame()
|
||||||
|
if ctx.my_id == ctx.host_id then
|
||||||
|
return GameGetFrameNum()
|
||||||
|
else
|
||||||
|
return ctx.host_frame_num
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
rpc.opts_everywhere()
|
||||||
|
function rpc.pet(entity_who_interacted, entity_interacted, num, hx, hy)
|
||||||
|
local rnd = entity_interacted
|
||||||
|
if not ctx.is_host then
|
||||||
|
entity_interacted = ctx.entity_by_remote_id[entity_interacted].id
|
||||||
|
end
|
||||||
|
entity_who_interacted = entity_who_interacted.entity or entity_who_interacted
|
||||||
|
local x, y = EntityGetTransform( entity_interacted )
|
||||||
|
|
||||||
|
edit_component( entity_interacted, "VelocityComponent", function(comp,vars)
|
||||||
|
ComponentSetValueVector2( comp, "mVelocity", 0, 0 )
|
||||||
|
end)
|
||||||
|
|
||||||
|
edit_component( entity_interacted, "CharacterDataComponent", function(comp,vars)
|
||||||
|
ComponentSetValueVector2( comp, "mVelocity", 0, 0 )
|
||||||
|
end)
|
||||||
|
|
||||||
|
edit_component( entity_who_interacted, "VelocityComponent", function(comp,vars)
|
||||||
|
ComponentSetValueVector2( comp, "mVelocity", 0, 0 )
|
||||||
|
end)
|
||||||
|
|
||||||
|
edit_component( entity_who_interacted, "CharacterDataComponent", function(comp,vars)
|
||||||
|
ComponentSetValueVector2( comp, "mVelocity", 0, 0 )
|
||||||
|
end)
|
||||||
|
|
||||||
|
SetRandomSeed( hx + rnd, hy + num )
|
||||||
|
rnd = Random( 1, 20 )
|
||||||
|
|
||||||
|
if ( rnd ~= 13 ) then
|
||||||
|
GamePlayAnimation( entity_interacted, "pet", 99, "stand", 0 )
|
||||||
|
EntitySetComponentsWithTagEnabled( entity_interacted, "enabled_if_charmed", false )
|
||||||
|
|
||||||
|
GamePrint( "$ui_longleg_love_msg1" )
|
||||||
|
else
|
||||||
|
EntityLoad( "data/entities/projectiles/explosion.xml", x, y )
|
||||||
|
|
||||||
|
GamePrint( "$ui_longleg_love_msg2" )
|
||||||
|
end
|
||||||
|
|
||||||
|
GameEntityPlaySound( entity_who_interacted, "pet" )
|
||||||
|
end
|
||||||
|
|
||||||
|
np.CrossCallAdd("ew_pet_hamis", function(x, y)
|
||||||
|
local hx, hy = EntityGetTransform(y)
|
||||||
|
local ent = y
|
||||||
|
for a, b in pairs(ctx.entity_by_remote_id) do
|
||||||
|
if b.id == y then
|
||||||
|
ent = a
|
||||||
|
end
|
||||||
|
end
|
||||||
|
rpc.pet(ctx.player_data_by_local_entity[x] or x, ent, frame(), hx, hy)
|
||||||
|
end)
|
||||||
|
|
||||||
|
return {}
|
|
@ -37,6 +37,17 @@ patch_perk_2("LEGGY_FEET", function(entity_perk_item, entity_who_picked, item_na
|
||||||
orig_fn(entity_perk_item, entity_who_picked, item_name, pickup_count)
|
orig_fn(entity_perk_item, entity_who_picked, item_name, pickup_count)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
for _, perk in ipairs(util.string_split(ctx.proxy_opt.perk_ban_list)) do
|
local function string_split( s, splitter )
|
||||||
|
local words = {};
|
||||||
|
if s == nil or splitter == nil then
|
||||||
|
return {}
|
||||||
|
end
|
||||||
|
for word in string.gmatch( s, '([^'..splitter..']+)') do
|
||||||
|
table.insert( words, word );
|
||||||
|
end
|
||||||
|
return words;
|
||||||
|
end
|
||||||
|
|
||||||
|
for _, perk in ipairs(string_split(CrossCall("ew_perk_ban_list"), ',')) do
|
||||||
hide_perk(perk)
|
hide_perk(perk)
|
||||||
end
|
end
|
|
@ -45,6 +45,8 @@ end
|
||||||
|
|
||||||
np.CrossCallAdd("ew_perks_modify_max_hp", rpc.modify_max_hp)
|
np.CrossCallAdd("ew_perks_modify_max_hp", rpc.modify_max_hp)
|
||||||
|
|
||||||
|
np.CrossCallAdd("ew_perk_ban_list", ctx.proxy_opt.perk_ban_list)
|
||||||
|
|
||||||
rpc.opts_everywhere()
|
rpc.opts_everywhere()
|
||||||
function rpc.sync_perk_amount(items, genome)
|
function rpc.sync_perk_amount(items, genome)
|
||||||
GlobalsSetValue("TEMPLE_SHOP_ITEM_COUNT", tostring(items))
|
GlobalsSetValue("TEMPLE_SHOP_ITEM_COUNT", tostring(items))
|
||||||
|
|
|
@ -122,6 +122,7 @@ local function load_modules()
|
||||||
ctx.load_system("gate_boss")
|
ctx.load_system("gate_boss")
|
||||||
ctx.load_system("tapion")
|
ctx.load_system("tapion")
|
||||||
ctx.load_system("world_sync_cuts")
|
ctx.load_system("world_sync_cuts")
|
||||||
|
ctx.load_system("hamis")
|
||||||
end
|
end
|
||||||
|
|
||||||
local function load_extra_modules()
|
local function load_extra_modules()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue