Compare commits
No commits in common. "eb6c6f1fe27be711cea835faecaf99922946f3a8" and "74506315b5a4d99b3304ef1434fcf179c8f46e13" have entirely different histories.
eb6c6f1fe2
...
74506315b5
2
nulllib
2
nulllib
@ -1 +1 @@
|
|||||||
Subproject commit 33d6ecaa03a4b4b9a63474cb7f26b5b14e83956c
|
Subproject commit a65b6b323dc7c3c80f0305b28f126cd9d2b317ac
|
97
script.lua
97
script.lua
@ -188,9 +188,6 @@ for _, v in pairs(EMISSIVES) do
|
|||||||
v:setColor(COLORS.neutral)
|
v:setColor(COLORS.neutral)
|
||||||
end
|
end
|
||||||
|
|
||||||
local gay_idiot_uuid="3dad78e8-6979-404f-820e-952ce20964a0" -- boy fren
|
|
||||||
--gay_idiot_uuid="468554f1-27cd-4ea1-9308-3dd14a9b1a12" -- alt account (testing)
|
|
||||||
|
|
||||||
-- }}}
|
-- }}}
|
||||||
|
|
||||||
-- PartsManager rules {{{
|
-- PartsManager rules {{{
|
||||||
@ -373,21 +370,6 @@ function setArmor(state)
|
|||||||
sharedconfig.save("armor_enabled", state)
|
sharedconfig.save("armor_enabled", state)
|
||||||
end
|
end
|
||||||
|
|
||||||
do
|
|
||||||
local purr_sound
|
|
||||||
|
|
||||||
---@param state boolean
|
|
||||||
function purr(state)
|
|
||||||
if state and not purr_sound then
|
|
||||||
purr_sound=sound_settings(sounds["entity.cat.purr"]):loop(true):play()
|
|
||||||
elseif not state then
|
|
||||||
purr_sound:stop()
|
|
||||||
purr_sound=nil
|
|
||||||
end
|
|
||||||
return purr_sound
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local snore
|
local snore
|
||||||
do
|
do
|
||||||
local snores={sounds["sounds.snore-1"], sounds["sounds.snore-2"], sounds["sounds.snore-3"]}
|
local snores={sounds["sounds.snore-1"], sounds["sounds.snore-2"], sounds["sounds.snore-3"]}
|
||||||
@ -401,8 +383,16 @@ do
|
|||||||
end
|
end
|
||||||
|
|
||||||
local function snore_purr()
|
local function snore_purr()
|
||||||
purr(true)
|
if not is_snoring then
|
||||||
statemonitor.register("snore", state_not_sleeping, function() purr(false) end, 5, true)
|
is_snoring=true
|
||||||
|
local purr_sound=sound_settings(sounds["entity.cat.purr"]):loop(true):play()
|
||||||
|
local function stop_playback()
|
||||||
|
purr_sound:stop()
|
||||||
|
is_snoring=false
|
||||||
|
end
|
||||||
|
statemonitor.register("snore", state_not_sleeping, stop_playback, 5, true)
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
local function snore_augh()
|
local function snore_augh()
|
||||||
@ -429,8 +419,7 @@ function pings.meow()
|
|||||||
sound_settings(sounds["entity.cat.ambient"]):play()
|
sound_settings(sounds["entity.cat.ambient"]):play()
|
||||||
end
|
end
|
||||||
events.CHAT_SEND_MESSAGE:register(function(msg)
|
events.CHAT_SEND_MESSAGE:register(function(msg)
|
||||||
if sharedconfig.load("is_cat") and string.match(msg, '^/') == nil then
|
if sharedconfig.load("is_cat") then pings.meow() end
|
||||||
pings.meow() end
|
|
||||||
return msg end,
|
return msg end,
|
||||||
"chat_meow")
|
"chat_meow")
|
||||||
|
|
||||||
@ -683,70 +672,22 @@ function hostTick()
|
|||||||
sharedstate.set("health", player:getHealth())
|
sharedstate.set("health", player:getHealth())
|
||||||
end
|
end
|
||||||
|
|
||||||
local gay_idiot_check
|
|
||||||
do
|
|
||||||
local nearby=false
|
|
||||||
local nearby_ticks=0
|
|
||||||
function pings.set_gay_idiot_nearby(state)
|
|
||||||
if state then
|
|
||||||
pings.expr("owo")
|
|
||||||
purr(true)
|
|
||||||
else
|
|
||||||
pings.expr("neutral")
|
|
||||||
purr(false)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local function set_gay_idiot_nearby(state)
|
|
||||||
if state ~= nearby then
|
|
||||||
nearby=state
|
|
||||||
pings.set_gay_idiot_nearby(state)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
---@param frequency? integer time since last check, default 1
|
|
||||||
function gay_idiot_check(frequency)
|
|
||||||
frequency=frequency or 1
|
|
||||||
nearby_ticks=nearby_ticks or 0
|
|
||||||
local gay_idiot=world.getEntity(gay_idiot_uuid)
|
|
||||||
|
|
||||||
-- if exists
|
|
||||||
if gay_idiot ~= nil then
|
|
||||||
-- if nearby then add to timer
|
|
||||||
local distance = (gay_idiot:getPos() - player:getPos()):length()
|
|
||||||
if distance <= 1 then
|
|
||||||
nearby_ticks=nearby_ticks+frequency
|
|
||||||
else
|
|
||||||
nearby_ticks=0
|
|
||||||
end
|
|
||||||
|
|
||||||
set_gay_idiot_nearby(nearby_ticks>=5*20)
|
|
||||||
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function tick()
|
function tick()
|
||||||
STATE.current.color_check=player:isInLava() ~=
|
STATE.current.color_check=player:isInLava() ~= (player:getDimensionName()=="minecraft:the_nether")
|
||||||
(player:getDimensionName()=="minecraft:the_nether")
|
|
||||||
if STATE.old.color_check~=STATE.current.color_check then
|
if STATE.old.color_check~=STATE.current.color_check then
|
||||||
setColor()
|
setColor()
|
||||||
end
|
end
|
||||||
-- optimization, only execute these with certain frequency --
|
-- optimization, only execute these once a second --
|
||||||
if world.getTime() % 5 == 0 then -- 1/4 second
|
if world.getTimeOfDay() % 20 == 0 then
|
||||||
|
|
||||||
if player:getPose() == "SLEEPING" then
|
if player:getPose() == "SLEEPING" then
|
||||||
snore()
|
snore()
|
||||||
end
|
end
|
||||||
|
|
||||||
if host:isHost() then gay_idiot_check(5) end
|
-- Sync state every 10 seconds
|
||||||
|
if world.getTimeOfDay() % (20*10) == 0 then
|
||||||
-- unneeded for now but can uncomment if needed
|
sharedstate.sync()
|
||||||
--if world.getTime() % 20 == 0 then -- 1 second
|
end
|
||||||
-- Sync state every 10 seconds
|
|
||||||
if world.getTime() % (20*10) == 0 then
|
|
||||||
sharedstate.sync()
|
|
||||||
end
|
|
||||||
--end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
hostTick()
|
hostTick()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user