Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- AddCSLuaFile()
- ENT.Type = "anim"
- ENT.PrintName = "Item"
- ENT.Category = "Kiraki"
- ENT.Spawnable = true
- ENT.AdminSpawnable = true
- ENT.AutomaticFrameAdvance = true
- if CLIENT then
- surface.CreateFont( "RaPD_WorldItem_Text", {
- font = "CloseCaption_Bold",
- size = 50,
- extended = false,
- blursize = 0.5,
- antialias = true,
- shadow = true,
- } )
- local namesDist = 300
- function ENT:Draw()
- self:DrawModel()
- local id = self:GetNW2String("RaPD_Item_Id", false)
- if id then
- local data = RaPD_Items[id]
- if data then
- local localize = KiraScripts.Localization.RaPD[KiraScripts.Localization.Language]
- if localize.Items[id] then
- local angs = (EyePos() - self:GetPos()):GetNormal():Angle()
- local ang = Angle(0,angs.y+90,angs.r+90)
- local ply = LocalPlayer()
- local pos = self:GetPos()
- local tr = util.TraceLine( {
- start = pos + self:OBBCenter(),
- endpos = ply:EyePos(),
- filter = {self, ply}
- } )
- local diff = pos - EyePos()
- local isLooking = ply:GetAimVector():Dot(diff) / diff:Length() >= 0.97
- local shouldFade = !isLooking or (tr.Hit or pos:DistToSqr(ply:GetPos()) >= namesDist*namesDist)
- self.NameAlpha = math.Approach(self.NameAlpha or 1, shouldFade and 0 or 1, 2*FrameTime())
- if self.NameAlpha >= 0.01 then
- if !self.spawnedTime then
- self.spawnedTime = 0
- end
- self.spawnedTime = self.spawnedTime + FrameTime()
- cam.Start3D2D( pos + Vector(0,0,math.sin(self.spawnedTime*2)*0.5+10) + angs:Forward()*10, ang, 0.05 )
- cam.IgnoreZ( true )
- local lighting = render.GetLightColor( pos )
- local col = data.icon_color or Color( 255, 255, 255 )
- local lightedColor = (Color( col.r, col.g, col.b, 255*self.NameAlpha ))
- //lightedColor.r = lightedColor.r*1-lightedColor.r*lighting.r
- //lightedColor.g = lightedColor.g*1-lightedColor.g*lighting.g
- //lightedColor.b = lightedColor.b*1-lightedColor.b*lighting.b
- draw.DrawText( localize.Items[id].Name or "ERROR", "RaPD_WorldItem_Text", 0, 0, lightedColor, 1 )
- cam.IgnoreZ( false )
- cam.End3D2D()
- end
- end
- end
- end
- end
- end
- function ENT:SpawnedParams( tbl )
- end
- function ENT:SpawnFunction( ply, tr, class )
- local tr,trace = {},{}
- tr.start = ply:GetShootPos()
- tr.endpos = tr.start + ply:GetAimVector() * 2000
- tr.filter = ply
- tr.mask = MASK_WATER + MASK_SOLID
- trace = util.TraceLine( tr )
- local SpawnPos = trace.HitPos + trace.HitNormal * 1
- local ent = ents.Create( class )
- ent:SetPos( SpawnPos )
- ent.Owner = ply
- ent.item = {id = self.SpawnableID or "kira_bandage"}
- ent:SetAngles( Angle(0, ply:EyeAngles().y + 180,0) )
- ent:Spawn()
- ent:Activate()
- return ent
- end
- if SERVER then
- function ENT:OnRemove()
- end
- function ENT:Think()
- end
- function ENT:Use(ply)
- if ply:RaPD_AddToInventory(self.item) then
- self.item.owner = ply
- self:Remove()
- ply:EmitSound("items/ammo_pickup.wav")
- end
- end
- function ENT:Initialize()
- local item = self.item
- if SERVER then
- if !item then
- self.item = {id = self.SpawnableID or "kira_bandage"}
- item = self.item
- end
- if item and !item.entityForDrop then
- item.entityForDrop = self:GetClass()
- end
- if item and item.id and item.id != "" then
- self.data = RaPD_Items[item.id]
- self:SetNW2String("RaPD_Item_Id", item.id)
- end
- local data = self.data
- self:SetModel(data.model or "models/hunter/blocks/cube025x025x025.mdl")
- self:SetMaterial(data.material or "")
- self:SetColor(data.model_color or Color(255,255,255))
- self:PhysicsInit(SOLID_VPHYSICS)
- self:SetMoveType(MOVETYPE_VPHYSICS)
- self:SetSolid(SOLID_VPHYSICS)
- self:SetUseType(SIMPLE_USE)
- if self.SpawnedParams then
- self:SpawnedParams( item )
- end
- end
- local phys = self:GetPhysicsObject()
- if (phys:IsValid()) then
- phys:Wake()
- end
- self:SetPlaybackRate(1)
- end
- end
- /*
- function RaPD_MakeTimedHookBeforeDead(name, user, target, limb, endTime, tickTime, tickFunc, endFunc, conditionFunc)
- local hookName = target:EntIndex().."_"..limb.."_Bandage_Think"
- local limbName = limb
- local endVarName = "RaPD_"..name.."_EndTime_"..limb
- local tickVarName = "RaPD_"..name.."_TickTime_"..limb
- target[endVarName] = CurTime() + endTime
- target[tickVarName] = CurTime() + tickTime
- hook.Add( "Think", hookName, function()
- local isValid = IsValid(target)
- if !isValid or !target:Alive() or (target[endVarName] and target[endVarName] <= CurTime()) or (isfunction(conditionFunc) and conditionFunc()) then
- if isfunction(endFunc) then endFunc() end
- hook.Remove( "Think", hookName)
- target[endVarName] = nil
- target[tickVarName] = nil
- elseif target[tickVarName] and target[tickVarName] <= CurTime() then
- if isfunction(tickFunc) then tickFunc() end
- target[tickVarName] = CurTime() + tickTime
- end
- end )
- end
- local function healBandages(mult, target, limb)
- target:RaPD_HealDamageLimb(2*mult, "piercing", limb)
- target:RaPD_HealDamageLimb(1*mult, "slash", limb)
- target:RaPD_HealDamageLimb(0.25*mult, "burn", limb)
- target:RaPD_HealDamageLimb(1.5*mult, "blast", limb)
- target:RaPD_HealDamageLimb(2*mult, "blunt", limb)
- end
- local function healBurns(mult, target, limb)
- target:RaPD_HealDamageLimb(1*mult, "burn", limb)
- end
- local function injectReagentFromContainer(item, count, target, reagent)
- local reagents = target.RaPD_Organism.Stats.reagents
- local count = count + (math.min(item.reagentCount - count, 0))
- item.reagentCount = item.reagentCount - count
- KiraScripts.RaPD_Reagents_FastCalc(reagents.Circulatory, reagent, count)
- end
- local function eatReagentFromContainer(item, count, target, reagent)
- local reagents = target.RaPD_Organism.Stats.reagents
- local count = count + (math.min(item.reagentCount - count, 0))
- print("В предмете вычтется: ", count)
- print("В предмете до: ", item.reagentCount)
- item.reagentCount = item.reagentCount - count
- print("------")
- print("В предмете после: ", item.reagentCount)
- print("В организме до: ", reagents.Stomach[reagent])
- KiraScripts.RaPD_Reagents_FastCalc(reagents.Stomach, reagent, count)
- print("В организме после: ", reagents.Stomach[reagent])
- print("---------------------------")
- end
- local function takeOutItem(ply, item)
- if SERVER then
- local pos = util.TraceLine( {
- start = ply:EyePos(),
- endpos = ply:EyePos() + ply:EyeAngles():Forward()*60,
- filter = function( ent ) return ent == ply end
- } ).HitPos
- local ent = ents.Create( "rapd_inventory_item" )
- ent:SetPos( pos )
- item.owner = ent
- ent.item = item
- ent:SetAngles( Angle(0, ply:EyeAngles().y + 180,0) )
- ent:Spawn()
- ent:Activate()
- end
- end
- local function surgeryOpen(target, org, limb)
- target:EmitSound("physics/flesh/flesh_squishy_impact_hard1.wav")
- if !org[limb].surgeryOpenedScar then
- target:RaPD_HealDamageLimb(-org[limb].MaxHP*0.45, "slash", limb)
- org[limb].surgeryOpenedScar = true
- end
- end
- local function surgeryClose(target, org, limb)
- target:EmitSound("physics/flesh/flesh_squishy_impact_hard4.wav")
- if org[limb].surgeryOpenedScar then
- target:RaPD_HealDamageLimb(org[limb].MaxHP*0.3, "slash", limb)
- org[limb].surgeryOpenedScar = false
- end
- target:RaPD_UpdateHealthInfoOnClientsNOW()
- end
- RaPD_UniversalUses = {
- TakeOut = {
- Queue = 100,
- Limbs = "All",
- UseTime = 0.5,
- conditions = function(user, target, limb)
- return true
- end,
- onUseStart = function(user, target, limb)
- end,
- onUseEnd = function(user, target, limb, item)
- takeOutItem(user, item)
- return true
- end,
- },
- BloodSample = {
- Queue = 2,
- Limbs = {"RightArm", "LeftArm"},
- UseTime = 1,
- conditions = function(user, target, limb)
- return true
- end,
- onUseStart = function(user, target, limb)
- end,
- onUseEnd = function(user, target, limb, item)
- local org = target.RaPD_Organism
- local data = org[limb]
- target:RaPD_TakeDamageLimb(1, "piercing", limb)
- target:EmitSound("garrysmod/ui_click.wav")
- target:EmitSound("physics/flesh/flesh_impact_bullet1.wav")
- target:RaPD_SetBleeding(limb, true, 8, 20)
- item.scanResultsMode = "Circulatory"
- item.scanResults = table.Copy(org.Stats.reagents)
- target:RaPD_UpdateHealthInfoOnClientsNOW()
- return false
- end,
- },
- SalivaSample = {
- Queue = 3,
- Limbs = "Head",
- UseTime = 1,
- conditions = function(user, target, limb)
- return true
- end,
- onUseStart = function(user, target, limb)
- end,
- onUseEnd = function(user, target, limb, item)
- local org = target.RaPD_Organism
- local data = org[limb]
- target:EmitSound("garrysmod/ui_click.wav")
- item.scanResultsMode = "Stomach"
- item.scanResults = table.Copy(org.Stats.reagents)
- target:RaPD_UpdateHealthInfoOnClientsNOW()
- return false
- end,
- },
- ScanLimbs = {
- Queue = 1,
- Limbs = "All",
- UseTime = 1,
- conditions = function(user, target, limb)
- return true
- end,
- onUseStart = function(user, target, limb)
- end,
- onUseEnd = function(user, target, limb, item)
- local org = target.RaPD_Organism
- local data = org[limb]
- target:EmitSound("garrysmod/ui_click.wav")
- item.scanResultsMode = "Limbs"
- item.scanResults = table.Copy(data)
- target:RaPD_UpdateHealthInfoOnClientsNOW()
- return false
- end,
- },
- ScanOrgans = {
- Queue = 8,
- Limbs = "All",
- UseTime = 2,
- conditions = function(user, target, limb)
- local org = target.RaPD_Organism
- local data = org[limb]
- return data.Organs
- end,
- onUseStart = function(user, target, limb)
- end,
- onUseEnd = function(user, target, limb, item)
- local org = target.RaPD_Organism
- local data = org[limb]
- target:EmitSound("garrysmod/ui_click.wav")
- item.scanResultsMode = "Organs"
- item.scanResults = table.Copy(data.Organs)
- target:RaPD_UpdateHealthInfoOnClientsNOW()
- return false
- end,
- },
- }
- RaPD_Items = {
- ["kira_bandage"] = {
- model = "models/props_junk/PopCan01a.mdl",
- material = "phoenix_storms/fender_white",
- model_color = Color(255,200,130),
- icon = "materials/kira_rapd/items/bandage.png",
- icon_color = Color(255,200,130),
- icon_color_back = Color(0,0,0),
- useMethods = {
- ["ApplyBandage"] = {
- Queue = 1,
- Limbs = "All",
- UseTime = 1.8,
- conditions = function(user, target, limb)
- local org = target.RaPD_Organism
- if !org then return end
- local limbData = org[limb]
- return !limbData.bandaged
- end,
- onUseStart = function(user, target, limb)
- end,
- onUseEnd = function(user, target, limb, item)
- if !item.uses then
- item.uses = 3
- end
- print("Перевязка от ",user," на ",target, "с конечностью ", limb)
- local org = target.RaPD_Organism
- if !org then return end
- local limbData = org[limb]
- if limbData.bleeding then limbData.bleeding = false end
- healBandages(2, target, limb)
- item.uses = item.uses - 1
- limbData.bandaged = true
- target:RaPD_UpdateHealthInfoOnClientsNOW()
- RaPD_MakeTimedHookBeforeDead("BandageHealing", user, target, limb, 30, 1, function()
- healBandages(0.5, target, limb)
- print("Исцеление от ",user," на ",target, "с конечностью ", limb)
- end, function()
- print("Завершение исцеления от ",user," на ",target, "с конечностью ", limb)
- limbData.bandaged = false
- target:RaPD_UpdateHealthInfoOnClientsNOW()
- end)
- return item.uses <= 0
- end,
- },
- ["TakeOut"] = RaPD_UniversalUses.TakeOut,
- },
- },
- ["kira_burn_ointment"] = {
- model = "models/props_lab/jar01b.mdl",
- model_color = Color(255,255,130),
- icon = "materials/kira_rapd/items/ointment.png",
- icon_color = Color(255,255,130),
- icon_color_back = Color(0,0,0),
- useMethods = {
- ["ApplyOintment"] = {
- Queue = 1,
- Limbs = "All",
- UseTime = 2,
- conditions = function(user, target, limb)
- return !target:GetNW2Bool("Limb_BurnCure_"..limb, false)
- end,
- onUseStart = function(user, target, limb)
- end,
- onUseEnd = function(user, target, limb)
- print("Перевязка от ",user," на ",target, "с конечностью ", limb)
- local org = target.RaPD_Organism
- if !org then return end
- local limbData = org[limb]
- if limbData.bleeding then limbData.bleeding = false end
- healBurns(2, target, limb)
- target:SetNW2Bool("Limb_BurnCure_"..limb, true)
- RaPD_MakeTimedHookBeforeDead("OintmentHealing", user, target, limb, 20, 1, function()
- healBurns(0.5, target, limb)
- print("Исцеление от ",user," на ",target, "с конечностью ", limb)
- end, function()
- print("Завершение исцеления от ",user," на ",target, "с конечностью ", limb)
- target:SetNW2Bool("Limb_BurnCure_"..limb, false)
- end)
- return true
- end,
- },
- ["TakeOut"] = RaPD_UniversalUses.TakeOut,
- },
- },
- ["kira_syringe"] = {
- model = "models/props_c17/TrapPropeller_Lever.mdl",
- model_color = Color(0,0,0),
- icon = "materials/kira_rapd/items/syringe.png",
- reagentsContainer = true,
- reagentsLimit = 80,
- icon_color = Color(180,180,200),
- icon_color_back = Color(0,0,0),
- useMethods = {
- ["Inject10"] = {
- Queue = 1,
- Limbs = "All",
- UseTime = 1.5,
- conditions = function(user, target, limb, item)
- if item.reagent and item.reagentCount and item.reagentCount > 0 then
- return true
- end
- return false
- end,
- onUseStart = function(user, target, limb, item)
- if item.reagent and item.reagentCount and item.reagentCount > 0 then
- end
- end,
- onUseEnd = function(user, target, limb, item)
- if item.reagent and item.reagentCount and item.reagentCount > 0 then
- injectReagentFromContainer(item, 10, target, item.reagent)
- end
- return false
- end,
- },
- ["Inject20"] = {
- Queue = 2,
- Limbs = "All",
- UseTime = 2,
- conditions = function(user, target, limb, item)
- if item.reagent and item.reagentCount and item.reagentCount > 0 then
- return true
- end
- return false
- end,
- onUseStart = function(user, target, limb, item)
- if item.reagent and item.reagentCount and item.reagentCount > 0 then
- end
- end,
- onUseEnd = function(user, target, limb, item)
- if item.reagent and item.reagentCount and item.reagentCount > 0 then
- injectReagentFromContainer(item, 20, target, item.reagent)
- end
- return false
- end,
- },
- ["Inject40"] = {
- Queue = 3,
- Limbs = "All",
- UseTime = 3,
- conditions = function(user, target, limb, item)
- if item.reagent and item.reagentCount and item.reagentCount > 0 then
- return true
- end
- return false
- end,
- onUseStart = function(user, target, limb, item)
- if item.reagent and item.reagentCount and item.reagentCount > 0 then
- end
- end,
- onUseEnd = function(user, target, limb, item)
- if item.reagent and item.reagentCount and item.reagentCount > 0 then
- injectReagentFromContainer(item, 40, target, item.reagent)
- end
- return false
- end,
- },
- ["Inject80"] = {
- Queue = 4,
- Limbs = "All",
- UseTime = 6,
- conditions = function(user, target, limb, item)
- if item.reagent and item.reagentCount and item.reagentCount > 0 then
- return true
- end
- return false
- end,
- onUseStart = function(user, target, limb, item)
- if item.reagent and item.reagentCount and item.reagentCount > 0 then
- end
- end,
- onUseEnd = function(user, target, limb, item)
- if item.reagent and item.reagentCount and item.reagentCount > 0 then
- injectReagentFromContainer(item, 80, target, item.reagent)
- end
- return false
- end,
- },
- ["TakeOut"] = RaPD_UniversalUses.TakeOut,
- },
- },
- ["kira_bloodbag"] = {
- model = "models/Items/HealthKit.mdl",
- model_color = Color(200,70,70),
- icon = "materials/kira_rapd/items/bloodbagbig.png",
- reagentsContainer = true,
- reagentsLimit = 1000,
- icon_color = Color(180,180,200),
- icon_color_back = Color(0,0,0),
- useMethods = {
- ["BloodBagInject"] = {
- Queue = 1,
- Limbs = "All",
- UseTime = 1.2,
- conditions = function(user, target, limb, item)
- if item.reagent and item.reagentCount and item.reagentCount > 0 and !target.RaPD_Organism[limb].bloodbagAttached and !item.opened then
- return true
- end
- return false
- end,
- onUseStart = function(user, target, limb, item)
- end,
- onUseEnd = function(user, target, limb, item)
- if item.reagent and item.reagentCount and item.reagentCount > 0 and !item.opened then
- target.RaPD_Organism[limb].bloodbagAttached = true
- item.opened = true
- local endInjection
- RaPD_MakeTimedHookBeforeDead("BloodBagInjectionThink_"..tostring(item), user, target, limb, 100, 0.4, function()
- if item.owner and IsValid(item.owner) and item.owner:GetPos():Distance(target:GetPos()) < 250 then
- injectReagentFromContainer(item, 5, target, item.reagent)
- if item.owner:IsPlayer() then item.owner:RaPD_UpdateInventory(2) end
- print("Исцеление от ",user," на ",target, "с конечностью ", limb)
- else
- endInjection = true
- target:RaPD_TakeDamageLimb(6, "piercing", limb)
- target:EmitSound("physics/flesh/flesh_impact_bullet1.wav")
- target:RaPD_SetBleeding(limb, true, 25, 65)
- net.Start( "RaPD_SpreadBlood" )
- net.WriteEntity(target)
- net.WriteFloat( 1 )
- net.Broadcast()
- print("Экстренное завершение исцеления от ",user," на ",target, "с конечностью ", limb)
- end
- end, function()
- print("Завершение исцеления от ",user," на ",target, "с конечностью ", limb)
- target.RaPD_Organism[limb].bloodbagAttached = false
- item.opened = false
- end, function()
- return endInjection or !item.opened or (!item.reagent or !item.reagentCount or item.reagentCount <= 0)
- end)
- end
- end,
- },
- ["BloodBagClose"] = {
- Queue = 2,
- Limbs = "All",
- UseTime = 0.7,
- conditions = function(user, target, limb, item)
- if item.opened then
- return true
- end
- return false
- end,
- onUseStart = function(user, target, limb, item)
- end,
- onUseEnd = function(user, target, limb, item)
- if item.opened then
- item.opened = false
- end
- end,
- },
- ["Drink"] = {
- Queue = 3,
- Limbs = "Head",
- UseTime = 1,
- conditions = function(user, target, limb)
- return true
- end,
- onUseStart = function(user, target, limb)
- end,
- onUseEnd = function(user, target, limb, item)
- local org = target.RaPD_Organism
- local stom = org.Stats.reagents.Stomach
- eatReagentFromContainer(item, 150, target, item.reagent)
- return false
- end,
- },
- ["TakeOut"] = RaPD_UniversalUses.TakeOut,
- },
- },
- ["kira_pill_charcoal"] = {
- model = "models/props_lab/jar01b.mdl",
- model_color = Color(80,155,80),
- icon = "materials/kira_rapd/items/pill.png",
- icon_color = Color(80,155,80),
- icon_color_back = Color(0,0,0),
- useMethods = {
- ["Eat"] = {
- Queue = 1,
- Limbs = "Head",
- UseTime = 1,
- conditions = function(user, target, limb)
- return true
- end,
- onUseStart = function(user, target, limb)
- end,
- onUseEnd = function(user, target, limb)
- local org = target.RaPD_Organism
- local stom = org.Stats.reagents.Stomach
- stom.charcoal = (stom.charcoal or 0) + 20
- return true
- end,
- },
- ["TakeOut"] = RaPD_UniversalUses.TakeOut,
- },
- },
- ["kira_splint"] = {
- model = "models/props_junk/garbage_bag001a.mdl",
- material = "phoenix_storms/fender_white",
- icon = "materials/kira_rapd/items/splint.png",
- useMethods = {
- ["ApplySplint"] = {
- Queue = 1,
- Limbs = {"LeftArm","LeftLeg","RightArm","RightLeg",},
- UseTime = 10,
- conditions = function(user, target, limb)
- local org = target.RaPD_Organism
- return org and org[limb] and org[limb].fracture
- end,
- onUseStart = function(user, target, limb)
- end,
- onUseEnd = function(user, target, limb)
- local org = target.RaPD_Organism
- if !org then return end
- if org[limb].fracture then
- org[limb].fracture = false
- target:RaPD_UpdateHealthInfoOnClients()
- return true
- end
- end,
- },
- ["TakeOut"] = RaPD_UniversalUses.TakeOut,
- },
- },
- ["kira_surgery_kit"] = {
- model = "models/props_c17/BriefCase001a.mdl",
- icon = "materials/kira_rapd/items/medkit_surgery.png",
- icon_color = Color(130,130,180),
- icon_color_back = Color(0,0,0),
- useMethods = {
- ["Surgery_FixOrgans"] = {
- Queue = 1,
- Limbs = {"Chest", "Head"},
- UseTime = 15,
- conditions = function(user, target, limb)
- local org = target.RaPD_Organism
- local data = org[limb]
- return data.Organs
- end,
- onUseStart = function(user, target, limb)
- local org = target.RaPD_Organism
- target:RaPD_UpdateHealthInfoOnClients()
- target:RaPD_SetBleeding(limb, true, 30, 50)
- surgeryOpen(target, org, limb)
- end,
- onUseEnd = function(user, target, limb)
- if (!target.RaPD_Organism) or !limb or !target.RaPD_Organism[limb] or !target.RaPD_Organism[limb].Organs then return end
- local organs = target.RaPD_Organism[limb].Organs
- for organ, data in pairs(organs) do
- print("1")
- PrintTable(data)
- if data.MaxHP and data.DMG and data.DMG > 0 then
- print("2")
- data.DMG = 0
- user:RaPD_Thought_Localized({"HealingOrgans", organ}, Color(250,250,250), 4, 1, 1, 1, 5, 8)
- print("3")
- print("-----------------------------------")
- end
- end
- local org = target.RaPD_Organism
- target:RaPD_SetBleeding(limb, false)
- surgeryClose(target, org, limb)
- target:RaPD_UpdateHealthInfoOnClients()
- end,
- },
- ["Surgery_FixBones"] = {
- Queue = 2,
- Limbs = {"LeftArm", "LeftLeg", "RightArm", "RightLeg", "Chest", "Head"},
- UseTime = 18,
- conditions = function(user, target, limb)
- local org = target.RaPD_Organism
- return org and org[limb] and org[limb].fracture
- end,
- onUseStart = function(user, target, limb)
- local org = target.RaPD_Organism
- target:RaPD_SetBleeding(limb, true, 30, 50)
- surgeryOpen(target, org, limb)
- end,
- onUseEnd = function(user, target, limb)
- local org = target.RaPD_Organism
- target:RaPD_SetBleeding(limb, false)
- surgeryClose(target, org, limb)
- if !org then return end
- if org[limb].fracture then
- org[limb].fracture = false
- end
- end,
- },
- ["Surgery_Close"] = {
- Queue = 3,
- Limbs = "All",
- UseTime = 2,
- conditions = function(user, target, limb)
- local org = target.RaPD_Organism
- return org and org[limb] and org[limb].surgeryOpenedScar
- end,
- onUseStart = function(user, target, limb)
- local org = target.RaPD_Organism
- end,
- onUseEnd = function(user, target, limb)
- local org = target.RaPD_Organism
- target:RaPD_SetBleeding(limb, false)
- surgeryClose(target, org, limb)
- end,
- },
- ["TakeOut"] = RaPD_UniversalUses.TakeOut,
- },
- },
- ["kira_scanner_lite"] = {
- model = "models/Items/battery.mdl",
- model_color = Color(65,155,222),
- icon = "materials/kira_rapd/items/scanner_lite.png",
- icon_color = Color(65,155,222),
- icon_color_back = Color(0,0,0),
- useMethods = {
- ["ScanReagents"] = RaPD_UniversalUses.BloodSample,
- ["ScanReagentsStomach"] = RaPD_UniversalUses.SalivaSample,
- ["TakeOut"] = RaPD_UniversalUses.TakeOut,
- },
- },
- ["kira_scanner_full"] = {
- model = "models/Items/battery.mdl",
- model_color = Color(222,100,167),
- icon = "materials/kira_rapd/items/scanner.png",
- icon_color = Color(222,100,167),
- icon_color_back = Color(0,0,0),
- useMethods = {
- ["ScanReagents"] = RaPD_UniversalUses.BloodSample,
- ["ScanReagentsStomach"] = RaPD_UniversalUses.SalivaSample,
- ["ScanLimbs"] = RaPD_UniversalUses.ScanLimbs,
- ["ScanOrgans"] = RaPD_UniversalUses.ScanOrgans,
- ["TakeOut"] = RaPD_UniversalUses.TakeOut,
- },
- },
- ["kira_scanner_debug"] = {
- model = "models/Items/battery.mdl",
- model_color = Color(255,191,63),
- icon = "materials/kira_rapd/items/scanner_debug.png",
- icon_color = Color(255,191,63),
- icon_color_back = Color(0,0,0),
- useMethods = {
- ["ScanCoded"] = {
- Queue = 1,
- Limbs = "All",
- UseTime = 1,
- conditions = function(user, target, limb)
- return true
- end,
- onUseStart = function(user, target, limb)
- end,
- onUseEnd = function(user, target, limb, item)
- local org = target.RaPD_Organism
- item.scanResults = "Реагенты в организме:\n\n"
- for k,v in pairs(org.Stats.reagents) do
- item.scanResults = item.scanResults..k.."\n"
- for k,v in pairs(v) do
- item.scanResults = item.scanResults.." "..k.." - "..v.."\n"
- end
- item.scanResults = item.scanResults.."\n"
- end
- if org[limb].bleeding then
- item.scanResults = "Кровотёк:\n\n"
- item.scanResults = item.scanResults.." "..tostring(org[limb].bleedingHeal).."/"..tostring(org[limb].bleedingHealNeed).."\n"
- else
- item.scanResults = "Кровотёк: Нет\n\n"
- end
- return false
- end,
- },
- ["TakeOut"] = RaPD_UniversalUses.TakeOut,
- },
- },
- }
- */
- print("[RaPD] Items are loaded!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement