diff --git a/lua/entities/scp_500_box/init.lua b/lua/entities/scp_500_box/init.lua
new file mode 100644
index 0000000..6aa5d44
--- /dev/null
+++ b/lua/entities/scp_500_box/init.lua
@@ -0,0 +1,78 @@
+-- SCP-1025, A representation of a paranormal object on a fictional series on the game Garry's Mod.
+-- Copyright (C) 2024 MrMarrant aka BIBI.
+-- This program is free software: you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation, either version 3 of the License, or
+-- (at your option) any later version.
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+-- You should have received a copy of the GNU General Public License
+-- along with this program. If not, see .
+
+AddCSLuaFile("shared.lua")
+include("shared.lua")
+function ENT:Initialize()
+ self:SetModel(SCP_1025_CONFIG.Models.Pill)
+ self:RebuildPhysics()
+ self:InitVar()
+ self.Delay = CurTime()
+end
+
+-- Initialise the physic of the entity
+function ENT:RebuildPhysics()
+ self:PhysicsInit(SOLID_VPHYSICS)
+ self:SetMoveType(MOVETYPE_VPHYSICS)
+ self:SetSolid(SOLID_VPHYSICS)
+ self:SetUseType(SIMPLE_USE)
+ self:PhysWake()
+end
+
+-- Use specially for the physics sounds
+function ENT:PhysicsCollide( data, physobj )
+ if data.DeltaTime > 0.2 then
+ if data.Speed > 250 then
+ self:EmitSound("physics/plastic/plastic_box_impact_hard" .. math.random(1, 4) .. ".wav", 75, math.random( 100, 110 ))
+ else
+ self:EmitSound("physics/plastic/plastic_box_impact_soft" .. math.random(1, 4) .. ".wav", 75, math.random( 100, 110 ))
+ end
+ end
+end
+
+function ENT:Consume(ply)
+ if (not IsValid(ply)) then return end
+ local cur = CurTime()
+ if (self.Delay > cur ) then return end
+ self.Delay = cur + SCP_1025_CONFIG.Settings.DelayGlycemiaReader
+ local count_pills = self:GetRemainingPills()
+
+ scp_1025.ClearDiseases(ply)
+ count_pills = count_pills - 1
+ self:SetRemainingPills(count_pills)
+ if (count_pills <= 0) then
+ self:EmitSound("physics/plastic/plastic_box_break" .. math.random(1, 2) .. ".wav", 75, math.random( 100, 110 ))
+ self:Remove()
+ end
+ ply:ChatPrint(scp_1025.GetTranslation("consume_scp500"))
+ ply:ChatPrint(scp_1025.GetTranslation("remaining_pills") .. count_pills)
+end
+
+function ENT:Use(ply)
+ if (not IsValid(ply)) then return end
+
+ self:Consume(ply)
+end
+
+function ENT:Touch(ent)
+ if (not IsValid(ent)) then return end
+ if (not ent:IsPlayer()) then return end
+ if (not ent.scp_1025_IsSleeping) then return end
+
+ self:Consume(ent)
+end
+
+-- Intialise every var related to the entity
+function ENT:InitVar( )
+ self:SetRemainingPills(SCP_1025_CONFIG.Settings.PillsNumber)
+end
\ No newline at end of file
diff --git a/lua/entities/scp_500_box/shared.lua b/lua/entities/scp_500_box/shared.lua
new file mode 100644
index 0000000..1436bdb
--- /dev/null
+++ b/lua/entities/scp_500_box/shared.lua
@@ -0,0 +1,27 @@
+-- SCP-1025, A representation of a paranormal object on a fictional series on the game Garry's Mod.
+-- Copyright (C) 2024 MrMarrant aka BIBI.
+
+-- This program is free software: you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation, either version 3 of the License, or
+-- (at your option) any later version.
+
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+
+-- You should have received a copy of the GNU General Public License
+-- along with this program. If not, see .
+
+ENT.Type = "anim"
+ENT.Base = "base_gmodentity"
+ENT.Author = "MrMarrant"
+ENT.PrintName = "SCP-500 Box"
+ENT.Spawnable = true
+ENT.Category = "SCP"
+
+-- Set up every var related to the entity we will use
+function ENT:SetupDataTables()
+ self:NetworkVar("Int", 0, "RemainingPills")
+end
\ No newline at end of file
diff --git a/lua/scp_1025/config/sh_config.lua b/lua/scp_1025/config/sh_config.lua
index 3b8e24f..8477c77 100644
--- a/lua/scp_1025/config/sh_config.lua
+++ b/lua/scp_1025/config/sh_config.lua
@@ -50,6 +50,7 @@ SCP_1025_CONFIG.Models.Insulin = "models/scp_1025/insulin/insulin.mdl"
SCP_1025_CONFIG.Models.GlycemiaReader = "models/scp_1025/insulin_reader/insulin_reader.mdl"
SCP_1025_CONFIG.Models.Writer = "models/scp_1025/writer/writer.mdl"
SCP_1025_CONFIG.Models.Inhalator = "models/scp_1025/inhaler/inhaler.mdl"
+SCP_1025_CONFIG.Models.Pill = "models/scp_1025/pills/pills.mdl"
--Sound Path
SCP_1025_CONFIG.Sounds = {}
@@ -236,8 +237,10 @@ SCP_1025_CONFIG.Settings.ParanoidColors = {
[ "$pp_colour_mulg" ] = 0,
[ "$pp_colour_mulb" ] = 0
}
+-- SCP-500 Settings
+SCP_1025_CONFIG.Settings.PillsNumber = 47
-
+-- TODO : Ajouter au système de traduction
-- Default Diseases
SCP_1025_CONFIG.DiseaseAvailable = {
common_cold = {
diff --git a/lua/scp_1025/language/sh_en.lua b/lua/scp_1025/language/sh_en.lua
index ab14a5b..72d8365 100644
--- a/lua/scp_1025/language/sh_en.lua
+++ b/lua/scp_1025/language/sh_en.lua
@@ -72,6 +72,10 @@ local LANG_EN = {
-- Other
chromium = "You are using the base branch version.\nI strongly recommend using the chromium branch x86-64 version\ninstead for better stability for SCP-1025.",
+
+ -- SCP-500
+ consume_scp500 = "You have consumed SCP-500, you feel better, like never before.",
+ remaining_pills = "Remaining pills : ",
}
scp_1025.AddLanguage("en", LANG_EN)
\ No newline at end of file
diff --git a/lua/scp_1025/language/sh_fr.lua b/lua/scp_1025/language/sh_fr.lua
index 56797e2..ccfb107 100644
--- a/lua/scp_1025/language/sh_fr.lua
+++ b/lua/scp_1025/language/sh_fr.lua
@@ -72,6 +72,10 @@ local LANG_FR = {
-- Other
chromium = "Je vous recommende vivement d'utiliser plutot la branche\nchromium x86-64 pour une meilleur stabilité de SCP-1025",
+
+ -- SCP-500
+ consume_scp500 = "Vous avez consommé SCP-500, vous vous sentez mieux, comme jamais auparavant.",
+ remaining_pills = "Pilules restantes : ",
}
scp_1025.AddLanguage("fr", LANG_FR)
\ No newline at end of file
diff --git a/materials/entities/scp_500_box.png b/materials/entities/scp_500_box.png
new file mode 100644
index 0000000..91d2e87
Binary files /dev/null and b/materials/entities/scp_500_box.png differ
diff --git a/materials/scp_1025/pills/m_pills_01.vmt b/materials/scp_1025/pills/m_pills_01.vmt
new file mode 100644
index 0000000..9a30502
--- /dev/null
+++ b/materials/scp_1025/pills/m_pills_01.vmt
@@ -0,0 +1,17 @@
+"VertexlitGeneric"
+{
+ $basetexture "scp_1025/pills/m_pills_01"
+ $phong "1"
+ $phongboost "5"
+ $phongfresnelranges "[.78 .9 1]"
+
+ $normalmapalphaenvmapmask "1"
+ $envmapfresnel "1"
+
+ $rimlight "1"
+ $rimmask "1"
+ $rimlightboost "1"
+ $rimlightexponent "2"
+
+ $envmaptintmult "[.25 .25 .25]"
+}
diff --git a/materials/scp_1025/pills/m_pills_01.vtf b/materials/scp_1025/pills/m_pills_01.vtf
new file mode 100644
index 0000000..53ab20b
Binary files /dev/null and b/materials/scp_1025/pills/m_pills_01.vtf differ
diff --git a/materials/scp_1025/pills/m_pills_02.vmt b/materials/scp_1025/pills/m_pills_02.vmt
new file mode 100644
index 0000000..683132b
--- /dev/null
+++ b/materials/scp_1025/pills/m_pills_02.vmt
@@ -0,0 +1,17 @@
+"VertexlitGeneric"
+{
+ $basetexture "scp_1025/pills/m_pills_02"
+ $phong "1"
+ $phongboost "5"
+ $phongfresnelranges "[.78 .9 1]"
+
+ $normalmapalphaenvmapmask "1"
+ $envmapfresnel "1"
+
+ $rimlight "1"
+ $rimmask "1"
+ $rimlightboost "1"
+ $rimlightexponent "2"
+
+ $envmaptintmult "[.25 .25 .25]"
+}
diff --git a/materials/scp_1025/pills/m_pills_02.vtf b/materials/scp_1025/pills/m_pills_02.vtf
new file mode 100644
index 0000000..ba56215
Binary files /dev/null and b/materials/scp_1025/pills/m_pills_02.vtf differ
diff --git a/materials/scp_1025/pills/m_pills_03.vmt b/materials/scp_1025/pills/m_pills_03.vmt
new file mode 100644
index 0000000..e624dfe
--- /dev/null
+++ b/materials/scp_1025/pills/m_pills_03.vmt
@@ -0,0 +1,17 @@
+"VertexlitGeneric"
+{
+ $basetexture "scp_1025/pills/m_pills_03"
+ $phong "1"
+ $phongboost "5"
+ $phongfresnelranges "[.78 .9 1]"
+
+ $normalmapalphaenvmapmask "1"
+ $envmapfresnel "1"
+
+ $rimlight "1"
+ $rimmask "1"
+ $rimlightboost "1"
+ $rimlightexponent "2"
+
+ $envmaptintmult "[.25 .25 .25]"
+}
diff --git a/materials/scp_1025/pills/m_pills_03.vtf b/materials/scp_1025/pills/m_pills_03.vtf
new file mode 100644
index 0000000..263dc3c
Binary files /dev/null and b/materials/scp_1025/pills/m_pills_03.vtf differ
diff --git a/models/scp_1025/pills/pills.dx80.vtx b/models/scp_1025/pills/pills.dx80.vtx
new file mode 100644
index 0000000..9d4b55b
Binary files /dev/null and b/models/scp_1025/pills/pills.dx80.vtx differ
diff --git a/models/scp_1025/pills/pills.dx90.vtx b/models/scp_1025/pills/pills.dx90.vtx
new file mode 100644
index 0000000..9baa7f6
Binary files /dev/null and b/models/scp_1025/pills/pills.dx90.vtx differ
diff --git a/models/scp_1025/pills/pills.mdl b/models/scp_1025/pills/pills.mdl
new file mode 100644
index 0000000..ef07d61
Binary files /dev/null and b/models/scp_1025/pills/pills.mdl differ
diff --git a/models/scp_1025/pills/pills.phy b/models/scp_1025/pills/pills.phy
new file mode 100644
index 0000000..c908252
Binary files /dev/null and b/models/scp_1025/pills/pills.phy differ
diff --git a/models/scp_1025/pills/pills.vvd b/models/scp_1025/pills/pills.vvd
new file mode 100644
index 0000000..0065566
Binary files /dev/null and b/models/scp_1025/pills/pills.vvd differ