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
28 changes: 14 additions & 14 deletions Lua/config/pointshop/clown.lua
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ category.Products = {
Limit = 5,
IsLimitGlobal = false,
Action = function (client)
local grenade = ItemPrefab.GetItemPrefab("fixfoamgrenade")
Entity.Spawner.AddItemToSpawnQueue(grenade, client.Character.Inventory, nil, nil, function (item)
local prefabGrenade = ItemPrefab.GetItemPrefab("fixfoamgrenade")
Entity.Spawner.AddItemToSpawnQueue(prefabGrenade, client.Character.Inventory, nil, nil, function (item)
item.AddTag("jailgrenade")
item.Description = Traitormod.Language.Pointshop.jailgrenade_desc

Expand All @@ -91,8 +91,8 @@ category.Products = {
IsLimitGlobal = false,
Action = function (client)
-- logic is implemented in pointshop/traitor.lua
local handcuffs = ItemPrefab.GetItemPrefab("handcuffs")
Entity.Spawner.AddItemToSpawnQueue(handcuffs, client.Character.Inventory, nil, nil, function (item)
local prefabHandcuffs = ItemPrefab.GetItemPrefab("handcuffs")
Entity.Spawner.AddItemToSpawnQueue(prefabHandcuffs, client.Character.Inventory, nil, nil, function (item)
item.Tags = "fakehandcuffs"
Traitormod.SendChatMessage(client, Traitormod.Language.FakeHandcuffsUsage , Color.Aqua)
end)
Expand All @@ -105,8 +105,8 @@ category.Products = {
Limit = 2,
IsLimitGlobal = false,
Action = function (client)
local clownCrate = ItemPrefab.GetItemPrefab("clowncrate")
Entity.Spawner.AddItemToSpawnQueue(clownCrate, client.Character.Inventory, nil, nil, function (item)
local prefabClownCrate = ItemPrefab.GetItemPrefab("clowncrate")
Entity.Spawner.AddItemToSpawnQueue(prefabClownCrate, client.Character.Inventory, nil, nil, function (item)
local items = {"clowncostume", "clowncostume", "clownsuitunique", "clownsuitunique", "clowndivingmask", "clowndivingmask", "clownmask", "clownmask", "clownmaskunique", "clownmaskunique", "toyhammer", "bikehorn"}

for key, value in pairs(items) do
Expand All @@ -122,8 +122,8 @@ category.Products = {
Limit = 1,
IsLimitGlobal = false,
Action = function (client)
local clownExosuit = ItemPrefab.GetItemPrefab("clownexosuit")
Entity.Spawner.AddItemToSpawnQueue(clownExosuit, client.Character.Inventory, nil, nil, function (item)
local prefabClownExosuit = ItemPrefab.GetItemPrefab("clownexosuit")
Entity.Spawner.AddItemToSpawnQueue(prefabClownExosuit, client.Character.Inventory, nil, nil, function (item)
local items = {"fuelrod", "oxygenitetank"}

for key, value in pairs(items) do
Expand Down Expand Up @@ -187,8 +187,8 @@ category.Products = {
Limit = 1,
IsLimitGlobal = false,
Action = function (client)
local suit = ItemPrefab.GetItemPrefab("divingsuit")
Entity.Spawner.AddItemToSpawnQueue(suit, client.Character.Inventory, nil, nil, function (item)
local prefabSuit = ItemPrefab.GetItemPrefab("divingsuit")
Entity.Spawner.AddItemToSpawnQueue(prefabSuit, client.Character.Inventory, nil, nil, function (item)
local light = item.GetComponentString("LightComponent")

item.set_InventoryIconColor(Color(100, 100, 100, 50))
Expand All @@ -206,8 +206,8 @@ category.Products = {
Entity.Spawner.AddItemToSpawnQueue(ItemPrefab.GetItemPrefab("oxygentank"), item.OwnInventory)
end)

local robes = ItemPrefab.GetItemPrefab("cultistrobes")
Entity.Spawner.AddItemToSpawnQueue(robes, client.Character.Inventory, nil, nil, function (item)
local prefabRobes = ItemPrefab.GetItemPrefab("cultistrobes")
Entity.Spawner.AddItemToSpawnQueue(prefabRobes, client.Character.Inventory, nil, nil, function (item)

item.set_InventoryIconColor(Color(100, 100, 100, 50))
item.SpriteColor = Color(0, 0, 0, 0)
Expand All @@ -219,8 +219,8 @@ category.Products = {
Networking.CreateEntityEvent(item, Item.ChangePropertyEventData(invColor, item))
end)

local cap = ItemPrefab.GetItemPrefab("ironhelmet")
Entity.Spawner.AddItemToSpawnQueue(cap, client.Character.Inventory, nil, nil, function (item)
local prefabHelmet = ItemPrefab.GetItemPrefab("ironhelmet")
Entity.Spawner.AddItemToSpawnQueue(prefabHelmet, client.Character.Inventory, nil, nil, function (item)

item.set_InventoryIconColor(Color(100, 100, 100, 50))
item.SpriteColor = Color(0, 0, 0, 0)
Expand Down
80 changes: 64 additions & 16 deletions Lua/config/pointshop/cultist.lua
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ category.Init = function ()
</overwrite>
]]

local husk = ItemPrefab.GetItemPrefab("huskeggs")
local element = husk.ConfigElement.Element.Element("MeleeWeapon")
local prefabHuskeggs = ItemPrefab.GetItemPrefab("huskeggs")
local element = prefabHuskeggs.ConfigElement.Element.Element("MeleeWeapon")
Traitormod.Patching.RemoveAll(element, "StatusEffect")
Traitormod.Patching.Add(element, replacement)

Expand All @@ -57,6 +57,33 @@ category.Init = function ()
end
end)

-- revivalfluid logic
Hook.Patch("Barotrauma.Items.Components.MeleeWeapon", "HandleImpact", function (instance, ptable)
if not instance.Item.HasTag("revivalfluid") then return end

local limb = ptable["targetFixture"].Body.UserData
if limb == nil or not LuaUserData.IsTargetType(limb, "Barotrauma.Limb") then return end

local character = limb.character
if character == nil or not character.IsHuman or not character.IsDead then return end

-- it will revive the character and give it the husk infection
character.Revive()
local infection = AfflictionPrefab.Prefabs["huskinfection"]
character.CharacterHealth.ApplyAffliction(character.AnimController.MainLimb, infection.Instantiate(100))
local affliction = character.CharacterHealth.GetAffliction("huskinfection", true)
if affliction then
affliction._strength = 100
end

Timer.Wait(function ()
local client = Traitormod.FindClientCharacter(character)
if client then
client.SetClientCharacter(character)
end
end, 1500)

end)

Hook.Add("meleeWeapon.handleImpact", "Cultist.Stinger", function (melee, target)
if melee.Item.Prefab.Identifier ~= "huskstinger" then return end
Expand Down Expand Up @@ -129,9 +156,9 @@ category.Products = {
IsLimitGlobal = false,
Action = function (client)
local prefabInjector = ItemPrefab.GetItemPrefab("autoinjectorheadset")
local prefabUEX = ItemPrefab.GetItemPrefab("huskeggs")
local prefabHuskeggs = ItemPrefab.GetItemPrefab("huskeggs")
Entity.Spawner.AddItemToSpawnQueue(prefabInjector, client.Character.Inventory, nil, nil, function (item)
Entity.Spawner.AddItemToSpawnQueue(prefabUEX, item.OwnInventory, nil, nil, function (item2)
Entity.Spawner.AddItemToSpawnQueue(prefabHuskeggs, item.OwnInventory, nil, nil, function (item2)
item2.Description = "Highly active husk eggs."
item2.set_InventoryIconColor(Color(0, 0, 255))
item2.SpriteColor = Color(0, 0, 255, 255)
Expand All @@ -156,8 +183,8 @@ category.Products = {
Limit = 4,
IsLimitGlobal = false,
Action = function (client)
local prefabInjector = ItemPrefab.GetItemPrefab("antibloodloss2")
Entity.Spawner.AddItemToSpawnQueue(prefabInjector, client.Character.Inventory, nil, nil, function (item)
local prefabBloodbag = ItemPrefab.GetItemPrefab("antibloodloss2")
Entity.Spawner.AddItemToSpawnQueue(prefabBloodbag, client.Character.Inventory, nil, nil, function (item)
local holdable = item.GetComponentString("Holdable")

local husk = AfflictionPrefab.Prefabs["huskinfection"]
Expand Down Expand Up @@ -188,8 +215,8 @@ category.Products = {
Limit = 1,
IsLimitGlobal = false,
Action = function (client)
local revolver = ItemPrefab.GetItemPrefab("ironhelmet")
Entity.Spawner.AddItemToSpawnQueue(revolver, client.Character.Inventory, nil, nil, function (item)
local prefabHelmet = ItemPrefab.GetItemPrefab("ironhelmet")
Entity.Spawner.AddItemToSpawnQueue(prefabHelmet, client.Character.Inventory, nil, nil, function (item)
item.Tags = "chocker"
item.Description = Traitormod.Language.Pointshop.choke_desc

Expand All @@ -212,8 +239,8 @@ category.Products = {
IsLimitGlobal = false,
Action = function (client)
-- logic is implemented in pointshop/traitor.lua
local handcuffs = ItemPrefab.GetItemPrefab("handcuffs")
Entity.Spawner.AddItemToSpawnQueue(handcuffs, client.Character.Inventory, nil, nil, function (item)
local prefabHandcuffs = ItemPrefab.GetItemPrefab("handcuffs")
Entity.Spawner.AddItemToSpawnQueue(prefabHandcuffs, client.Character.Inventory, nil, nil, function (item)
item.Tags = "fakehandcuffs"
Traitormod.SendChatMessage(client, Traitormod.Language.FakeHandcuffsUsage , Color.Aqua)
end)
Expand All @@ -230,14 +257,35 @@ category.Products = {
end
},

{
Identifier = "revivalfluid",
Price = 2750,
Limit = 1,
IsLimitGlobal = false,
Action = function (client, product, items)
local prefabHuskeggs = ItemPrefab.GetItemPrefab("huskeggs")
Entity.Spawner.AddItemToSpawnQueue(prefabHuskeggs, client.Character.Inventory, nil, nil, function (item)
item.Tags = "revivalfluid"
item.Description = Traitormod.Language.Pointshop.revivalfluid_desc

item.set_InventoryIconColor(Color(255, 191, 0))
item.SpriteColor = Color(255, 191, 0)
local color = item.SerializableProperties[Identifier("SpriteColor")]
Networking.CreateEntityEvent(item, Item.ChangePropertyEventData(color, item))
local invColor = item.SerializableProperties[Identifier("InventoryIconColor")]
Networking.CreateEntityEvent(item, Item.ChangePropertyEventData(invColor, item))
end)
end
},

{
Identifier = "invisibilitygear",
Price = 800,
Limit = 1,
IsLimitGlobal = false,
Action = function (client)
local suit = ItemPrefab.GetItemPrefab("divingsuit")
Entity.Spawner.AddItemToSpawnQueue(suit, client.Character.Inventory, nil, nil, function (item)
local prefabSuit = ItemPrefab.GetItemPrefab("divingsuit")
Entity.Spawner.AddItemToSpawnQueue(prefabSuit, client.Character.Inventory, nil, nil, function (item)
local light = item.GetComponentString("LightComponent")

item.set_InventoryIconColor(Color(100, 100, 100, 50))
Expand All @@ -255,8 +303,8 @@ category.Products = {
Entity.Spawner.AddItemToSpawnQueue(ItemPrefab.GetItemPrefab("oxygentank"), item.OwnInventory)
end)

local robes = ItemPrefab.GetItemPrefab("zealotrobes")
Entity.Spawner.AddItemToSpawnQueue(robes, client.Character.Inventory, nil, nil, function (item)
local prefabRobes = ItemPrefab.GetItemPrefab("zealotrobes")
Entity.Spawner.AddItemToSpawnQueue(prefabRobes, client.Character.Inventory, nil, nil, function (item)

item.set_InventoryIconColor(Color(100, 100, 100, 50))
item.SpriteColor = Color(0, 0, 0, 0)
Expand All @@ -268,8 +316,8 @@ category.Products = {
Networking.CreateEntityEvent(item, Item.ChangePropertyEventData(invColor, item))
end)

local cap = ItemPrefab.GetItemPrefab("ironhelmet")
Entity.Spawner.AddItemToSpawnQueue(cap, client.Character.Inventory, nil, nil, function (item)
local prefabHelmet = ItemPrefab.GetItemPrefab("ironhelmet")
Entity.Spawner.AddItemToSpawnQueue(prefabHelmet, client.Character.Inventory, nil, nil, function (item)

item.set_InventoryIconColor(Color(100, 100, 100, 50))
item.SpriteColor = Color(0, 0, 0, 0)
Expand Down
24 changes: 12 additions & 12 deletions Lua/config/pointshop/traitor.lua
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ category.Products = {
Limit = 1,
IsLimitGlobal = false,
Action = function (client)
local suit = ItemPrefab.GetItemPrefab("divingsuit")
Entity.Spawner.AddItemToSpawnQueue(suit, client.Character.Inventory, nil, nil, function (item)
local prefabSuit = ItemPrefab.GetItemPrefab("divingsuit")
Entity.Spawner.AddItemToSpawnQueue(prefabSuit, client.Character.Inventory, nil, nil, function (item)
local light = item.GetComponentString("LightComponent")

item.set_InventoryIconColor(Color(100, 100, 100, 50))
Expand All @@ -120,8 +120,8 @@ category.Products = {
Entity.Spawner.AddItemToSpawnQueue(ItemPrefab.GetItemPrefab("oxygentank"), item.OwnInventory)
end)

local robes = ItemPrefab.GetItemPrefab("cultistrobes")
Entity.Spawner.AddItemToSpawnQueue(robes, client.Character.Inventory, nil, nil, function (item)
local prefabRobes = ItemPrefab.GetItemPrefab("cultistrobes")
Entity.Spawner.AddItemToSpawnQueue(prefabRobes, client.Character.Inventory, nil, nil, function (item)

item.set_InventoryIconColor(Color(100, 100, 100, 50))
item.SpriteColor = Color(0, 0, 0, 0)
Expand All @@ -133,8 +133,8 @@ category.Products = {
Networking.CreateEntityEvent(item, Item.ChangePropertyEventData(invColor, item))
end)

local cap = ItemPrefab.GetItemPrefab("ironhelmet")
Entity.Spawner.AddItemToSpawnQueue(cap, client.Character.Inventory, nil, nil, function (item)
local prefabHelmet = ItemPrefab.GetItemPrefab("ironhelmet")
Entity.Spawner.AddItemToSpawnQueue(prefabHelmet, client.Character.Inventory, nil, nil, function (item)

item.set_InventoryIconColor(Color(100, 100, 100, 50))
item.SpriteColor = Color(0, 0, 0, 0)
Expand All @@ -154,8 +154,8 @@ category.Products = {
Limit = 1,
IsLimitGlobal = false,
Action = function (client)
local revolver = ItemPrefab.GetItemPrefab("revolver")
Entity.Spawner.AddItemToSpawnQueue(revolver, client.Character.Inventory, nil, nil, function (item)
local prefabRevolver = ItemPrefab.GetItemPrefab("revolver")
Entity.Spawner.AddItemToSpawnQueue(prefabRevolver, client.Character.Inventory, nil, nil, function (item)
item.Tags = "teleporter"
item.Description = "‖color:gui.red‖A special revolver with teleportation features...‖color:end‖"

Expand All @@ -180,8 +180,8 @@ category.Products = {
Limit = 1,
IsLimitGlobal = false,
Action = function (client)
local revolver = ItemPrefab.GetItemPrefab("ironhelmet")
Entity.Spawner.AddItemToSpawnQueue(revolver, client.Character.Inventory, nil, nil, function (item)
local prefabHelmet = ItemPrefab.GetItemPrefab("ironhelmet")
Entity.Spawner.AddItemToSpawnQueue(prefabHelmet, client.Character.Inventory, nil, nil, function (item)
item.Tags = "chocker"
item.Description = Traitormod.Language.Pointshop.choke_desc

Expand All @@ -204,8 +204,8 @@ category.Products = {
IsLimitGlobal = false,
Action = function (client)
-- logic is implemented in pointshop/traitor.lua
local handcuffs = ItemPrefab.GetItemPrefab("handcuffs")
Entity.Spawner.AddItemToSpawnQueue(handcuffs, client.Character.Inventory, nil, nil, function (item)
local prefabHandcuffs = ItemPrefab.GetItemPrefab("handcuffs")
Entity.Spawner.AddItemToSpawnQueue(prefabHandcuffs, client.Character.Inventory, nil, nil, function (item)
item.Tags = "fakehandcuffs"
Traitormod.SendChatMessage(client, Traitormod.Language.FakeHandcuffsUsage , Color.Aqua)
end)
Expand Down
2 changes: 2 additions & 0 deletions Lua/language/english.lua
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,8 @@ language.PointshopRefunded = "You have been refunded %s points for your %s purch


language.Pointshop = {
revivalfluid = "Revival Fluid",
revivalfluid_desc = "‖color:gui.yellow‖Revives a dead corpse as a husk‖color:end‖",
fakehandcuffs = "Fake Cuffs",
choke = "Chocker",
choke_desc = "‖color:gui.red‖Silences the target‖color:end‖",
Expand Down