Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Lua/config/baseconfig.lua
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@ config.RandomEventConfig = {
dofile(Traitormod.Path .. "/Lua/config/randomevents/prisoner.lua"),
dofile(Traitormod.Path .. "/Lua/config/randomevents/randomlights.lua"),
dofile(Traitormod.Path .. "/Lua/config/randomevents/clownmagic.lua"),
dofile(Traitormod.Path .. "/Lua/config/randomevents/wombocombo.lua"),
}
}

Expand Down
21 changes: 20 additions & 1 deletion Lua/config/pointshop/clown.lua
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,24 @@ category.Products = {
Items = {"detonator"},
},

{
Identifier = "wombocombo",
Price = 450,
Limit = 4,
IsLimitGlobal = true,

CanBuy = function (client, product)
return not (Traitormod.RoundEvents.IsEventActive("WomboCombo") or
Traitormod.RoundEvents.IsEventActive("CommunicationsOffline") or
Traitormod.RoundEvents.IsEventActive("RandomLights") or
Traitormod.RoundEvents.IsEventActive("LightsOff"))
end,

Action = function ()
Traitormod.RoundEvents.TriggerEvent("WomboCombo")
end
},

{
Identifier = "clownmagic",
Price = 450,
Expand All @@ -255,7 +273,8 @@ category.Products = {
IsLimitGlobal = true,

CanBuy = function (client, product)
return not Traitormod.RoundEvents.IsEventActive("RandomLights")
return not (Traitormod.RoundEvents.IsEventActive("RandomLights") or
Traitormod.RoundEvents.IsEventActive("LightsOff"))
end,

Action = function ()
Expand Down
3 changes: 2 additions & 1 deletion Lua/config/pointshop/traitor.lua
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,8 @@ category.Products = {
IsLimitGlobal = true,

CanBuy = function (client, product)
return not Traitormod.RoundEvents.IsEventActive("LightsOff")
return not (Traitormod.RoundEvents.IsEventActive("LightsOff") or
Traitormod.RoundEvents.IsEventActive("RandomLights"))
end,

Action = function ()
Expand Down
2 changes: 1 addition & 1 deletion Lua/config/randomevents/oxygengenhusk.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ event.Start = function ()
local text = Traitormod.Language.OxygenHusk
Traitormod.RoundEvents.SendEventMessage(text, "GameModeIcon.pvp", Color.DarkMagenta)

local poison = AfflictionPrefab.Prefabs["huskinfection"]
local function GivePoison(character)
if character.Submarine ~= Submarine.MainSub then return end
if character.IsDead then return end
Expand All @@ -20,7 +21,6 @@ event.Start = function ()
if headGear ~= nil and headGear.Prefab.Identifier == "divingmask" then return end
if headGear ~= nil and headGear.Prefab.Identifier == "clowndivingmask" then return end

local poison = AfflictionPrefab.Prefabs["huskinfection"]
character.CharacterHealth.ApplyAffliction(character.AnimController.MainLimb, poison.Instantiate(50))
end

Expand Down
2 changes: 1 addition & 1 deletion Lua/config/randomevents/oxygengenpoison.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ event.Start = function ()
local text = Traitormod.Language.OxygenPoison
Traitormod.RoundEvents.SendEventMessage(text, "GameModeIcon.pvp", Color.Red)

local poison = AfflictionPrefab.Prefabs["sufforinpoisoning"]
local function GivePoison(character)
if character.Submarine ~= Submarine.MainSub then return end
if character.IsDead then return end
Expand All @@ -20,7 +21,6 @@ event.Start = function ()
if headGear ~= nil and headGear.Prefab.Identifier == "divingmask" then return end
if headGear ~= nil and headGear.Prefab.Identifier == "clowndivingmask" then return end

local poison = AfflictionPrefab.Prefabs["sufforinpoisoning"]
character.CharacterHealth.ApplyAffliction(character.AnimController.MainLimb, poison.Instantiate(20))
end

Expand Down
87 changes: 87 additions & 0 deletions Lua/config/randomevents/wombocombo.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
local event = {}

event.Name = "WomboCombo"
event.ChancePerMinute = 0
event.OnlyOncePerRound = true

event.Time = 1

event.FlickerAmount = 3 -- one cycle of On and Off

event.Lights = {} -- (key=item, value=originalLightComponentColor)

event.Start = function ()
-- Applying afflications
local poison = AfflictionPrefab.Prefabs["deliriuminepoisoning"]
local psychosis = AfflictionPrefab.Prefabs["psychosis"]
local hallucination = AfflictionPrefab.Prefabs["hallucinating"]

local function GiveWombo(character)
if character.Submarine ~= Submarine.MainSub then return end
if character.IsDead then return end

character.CharacterHealth.ApplyAffliction(character.AnimController.MainLimb, poison.Instantiate(100))
character.CharacterHealth.ApplyAffliction(character.AnimController.MainLimb, psychosis.Instantiate(100))
character.CharacterHealth.ApplyAffliction(character.AnimController.MainLimb, hallucination.Instantiate(100))
end
for key, value in pairs(Character.CharacterList) do
GiveWombo(value)
end


-- Disabling comms
if not Traitormod.RoundEvents.IsEventActive("CommunicationsOffline") then
Traitormod.RoundEvents.TriggerEvent("CommunicationsOffline")
end


-- Finding all LightComponents and their original color
for k, v in pairs(Submarine.MainSub.GetItems(true)) do
local c = v.GetComponentString('LightComponent')
if c and not v.Prefab.CanBeBought then
event.Lights[v] = c.LightColor
end
end

-- turn lights off and on depending on the current flickering state
local function setlightscolor(color)
for item, originalColor in pairs(event.Lights) do
Timer.Wait(function ()
local c = item.GetComponentString('LightComponent')
-- if color is nil it will revert it back to the original color
c.LightColor = color or originalColor
local prop = c.SerializableProperties[Identifier("LightColor")]
Networking.CreateEntityEvent(item, Item.ChangePropertyEventData(prop, c))
end, math.random(0, 1000)) -- delay shouldnt be greater then Time/(FlickerAmount*2)
end
end

-- flicker the lights
for i = 0, event.FlickerAmount-1, 1 do
Timer.Wait(
function()
setlightscolor(Color(0, 0, 0, 128))

Timer.Wait(function()
setlightscolor(nil)
end, event.Time/event.FlickerAmount * 60000 / 2)
end, i * event.Time/event.FlickerAmount * 60000)
end

-- end the event
Timer.Wait(event.End, event.Time * 60000)
end


event.End = function ()
for item, _ in pairs(event.Lights) do
event.Lights[item] = nil
end
if not isEndRound then
local text = Traitormod.Language.OxygenSafe

Traitormod.RoundEvents.SendEventMessage(text, "GameModeIcon.multiplayercampaign")
end
end

return event
3 changes: 3 additions & 0 deletions Lua/language/english.lua
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,8 @@ language.WreckPirate = "There have been reports about a notorious pirate with a
language.PirateInside = "Attention! A dangerous PUCS pirate has been detected inside the main submarine!"
language.PirateKilled = "The PUCS pirate has been killed, the crew has received a reward of %s points."

language.WomboCombo = "Your mind is shattering into fragments of emptiness and your soul is imploding on itself."
language.WomboCombo = "Then Clown said, “Let there be chaos,” and there was chaos."
language.ClownMagic = "You feel a strange sensation, and suddenly you're somewhere else."
language.CommunicationsOffline = "Something is interfering with all our communications systems. It's been estimated that communications will be offline for atleast %s minutes."
language.CommunicationsBack = "Communications are back online."
Expand Down Expand Up @@ -256,6 +258,7 @@ language.Pointshop = {
clowntalenttree = "Clown Talent Tree",
invisibilitygear = "Invisibility Gear",
clownmagic = "Clown Magic (Randomly swaps places of people)",
wombocombo = "Wombo Combo (Causes chaos)",
randomizelights = "Randomize Lights",
fuelrodlowquality = "Low Quality Fuel Rod",
gardeningkit = "Gardening Kit",
Expand Down