diff --git a/Lua/config/pointshop/clown.lua b/Lua/config/pointshop/clown.lua index 42d74ab2..300262dc 100644 --- a/Lua/config/pointshop/clown.lua +++ b/Lua/config/pointshop/clown.lua @@ -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 @@ -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) @@ -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 @@ -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 @@ -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)) @@ -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) @@ -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) diff --git a/Lua/config/pointshop/cultist.lua b/Lua/config/pointshop/cultist.lua index 8de84121..39a07d40 100644 --- a/Lua/config/pointshop/cultist.lua +++ b/Lua/config/pointshop/cultist.lua @@ -37,8 +37,8 @@ category.Init = function () ]] - 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) @@ -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 @@ -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) @@ -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"] @@ -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 @@ -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) @@ -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)) @@ -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) @@ -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) diff --git a/Lua/config/pointshop/traitor.lua b/Lua/config/pointshop/traitor.lua index 5fa158e6..bfa98591 100644 --- a/Lua/config/pointshop/traitor.lua +++ b/Lua/config/pointshop/traitor.lua @@ -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)) @@ -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) @@ -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) @@ -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‖" @@ -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 @@ -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) diff --git a/Lua/language/english.lua b/Lua/language/english.lua index b3378fcc..093d5021 100644 --- a/Lua/language/english.lua +++ b/Lua/language/english.lua @@ -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‖",