code_gs

Cocks

Jan 28th, 2020 (edited)
993
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 7.40 KB | None | 0 0
  1. -- This code is by Swadical
  2.  
  3. --[[
  4. Cock V2
  5.  
  6. Harder
  7. Faster
  8. Better
  9. Stronger
  10.  
  11. EVERLASTING ERECTION EDITION
  12. ]]
  13.  
  14. --shallow copy
  15. cookie.cock = function()
  16.     local function copy(tbl)
  17.         local out = {}
  18.         for k,v in pairs(tbl) do
  19.             out[k] = v
  20.         end
  21.         return out
  22.     end
  23.  
  24.     local cock = {
  25.         proto = {},
  26.         __meta = {},
  27.         data = {},
  28.         internal = {}
  29.     }
  30.  
  31.     --Internal; do not call
  32.     function cock:getData(obj)
  33.         return cookie.GetProtected().cockData
  34.     end
  35.  
  36.     do
  37.         --enums
  38.  
  39.         UNITS_METRIC_METRES = 1
  40.         UNITS_METRIC_CENTIMETRES = 2
  41.         UNITS_IMPERIAL_INCHES = 3
  42.  
  43.         VIAGRA_STAMINA = 1
  44.         VIAGRA_SIZE = 2
  45.         VIAGRA_EJACULATION = 3
  46.     end
  47.  
  48.     do
  49.         local __self = cock.__meta
  50.  
  51.         local warning = {"It's bad to look under the skin of a cock"}
  52.         setmetatable(warning,{__tostring=function() return "It's bad to look under the skin of a cock" end,__metatable = "It's bad to look under the skin of a cock"})
  53.         __self.__metatable = warning
  54.  
  55.         function __self:__newindex()
  56.             print("It's bad to put things inside a cock")
  57.         end
  58.  
  59.         function __self:__index(k)
  60.             timer.Simple(0,cookie.Save)
  61.             return cock.proto[k]
  62.         end
  63.  
  64.         function __self:__call()
  65.             cock.proto.Show(self)
  66.         end
  67.  
  68.         function __self:__concat()
  69.             --maybe sex?
  70.             return cock.proto.ShowString(self)
  71.         end
  72.  
  73.         function __self:__tostring()
  74.             return cock.proto.ShowString(self)
  75.         end
  76.     end
  77.  
  78.     do
  79.         local self = {}
  80.         cock.data.base = self
  81.  
  82.         --boolean
  83.         self.isErect = false
  84.         self.isDead = false
  85.  
  86.         --number
  87.         self.size = 0.15--assume metres. viva la SI units
  88.  
  89.         self.sizeCoefficient = 1
  90.         self.erectionCoefficient = 5--x larger when erect
  91.         self.ejaculationCoefficient = 3
  92.         self.staminaCoefficient = 300
  93.  
  94.         self.pills = 0
  95.         self.maxPills = 10
  96.  
  97.         self.range_min = 0.02--when flaccid.
  98.         self.range_max = 0.07--when flaccid.
  99.  
  100.         self.currentStrokes = 0
  101.  
  102.         --string
  103.         self.name = "Cock"--proper noun
  104.  
  105.         --miscellaneous
  106.         self.unitsSystem = UNITS_METRIC_CENTIMETRES
  107.     end
  108.  
  109.     do
  110.         local __self = cock.proto
  111.  
  112.         function __self:GetName()
  113.             return cock:getData(self).name
  114.         end
  115.  
  116.         function __self:SetName(name)
  117.             cock:getData(self).name = name
  118.         end
  119.  
  120.         function __self:Raise()
  121.             cock:getData(self).isErect = true
  122.             print(self:GetName().." is now hardening...")
  123.         end
  124.  
  125.         function __self:Lower()
  126.             cock:getData(self).isErect = false
  127.             print(self:GetName().." is now becoming flaccid...")
  128.         end
  129.  
  130.         function __self:ToggleState()
  131.             if self:GetStateEx() then
  132.                 self:Lower()
  133.             else
  134.                 self:Raise()
  135.             end
  136.         end
  137.  
  138.         --Internal; do not call
  139.         function __self:GetStateEx()
  140.             return cock:getData(self).isErect
  141.         end
  142.  
  143.         function __self:GetState()
  144.             if(cock:getData(self).isDead) then
  145.                 return "dead"
  146.             else
  147.                 return cock:getData(self).isErect and "erect" or "flaccid"
  148.             end
  149.         end
  150.  
  151.         function __self:SetUnitsSystem(enum)
  152.             cock:getData(self).unitsSystem = enum or UNITS_METRIC_CENTIMETRES
  153.         end
  154.  
  155.         --Internal; do not call
  156.         function __self:FormatLength(length)
  157.             local system = cock:getData(self).unitsSystem
  158.             if(system == UNITS_METRIC_CENTIMETRES) then
  159.                 return tostring(math.floor(length * 1000)/10).." cm"
  160.             elseif(system == UNITS_IMPERIAL_INCHES) then
  161.                 return tostring(math.floor(length * 393.701)/10).."\""
  162.             else
  163.                 return tostring(math.floor(length * 100)/100).." m"
  164.             end
  165.         end
  166.  
  167.         function __self:GetErectionCoefficient()
  168.             return cock:getData(self).erectionCoefficient
  169.         end
  170.  
  171.         function __self:GetEjaculationCoefficient()
  172.             return cock:getData(self).ejaculationCoefficient
  173.         end
  174.  
  175.         function __self:GetSizeCoefficient()
  176.             return cock:getData(self).sizeCoefficient
  177.         end
  178.  
  179.         function __self:GetLength()
  180.             if(self:GetStateEx()) then
  181.                 return cock:getData(self).length * self:GetErectionCoefficient() * self:GetSizeCoefficient()
  182.             else
  183.                 return cock:getData(self).length * self:GetSizeCoefficient()
  184.             end
  185.         end
  186.  
  187.         --Internal; do not call
  188.         function __self:tostring()
  189.             return self:FormatLength(self:GetLength()).." "..self:GetState().." "..self:GetName()
  190.         end
  191.  
  192.         function __self:Visualise()
  193.             return "8"..("="):rep(math.floor(self:GetLength() * 100)).."D"
  194.         end
  195.  
  196.         function __self:VisualiseEjaculation()
  197.             return "8"..("="):rep(math.floor(self:GetLength() * 100)).."D"..("~"):rep(math.floor(self:GetEjaculationCoefficient()))
  198.         end
  199.  
  200.         --Internal; do not call
  201.         function __self:Die(sfx)
  202.             cock:getData(self).length = 0
  203.             cock:getData(self).isDead = true
  204.  
  205.             print("*"..(sfx or "splat").."*\n"..self:GetName().." has died!")
  206.         end
  207.  
  208.         --Internal; do not call
  209.         function __self:doAliveCheck()
  210.             if(cock:getData(self).isDead) then
  211.                 print(self:GetName().." is dead!")
  212.                 return true
  213.             end
  214.             return false
  215.         end
  216.  
  217.         --Internal; do not call
  218.         function __self:doOnViagraCheck(sfx)
  219.             if(cock:getData(self).pills > cock:getData(self).maxPills) then
  220.                 self:Die(sfx)
  221.                 return true
  222.             end
  223.             return false
  224.         end
  225.  
  226.         function __self:FeedViagra(enum)
  227.             if(self:doAliveCheck()) then return end
  228.             cock:getData(self).pills = cock:getData(self).pills + 1
  229.             if(enum == VIAGRA_SIZE) then
  230.                 if(self:doOnViagraCheck("kabaam")) then return end
  231.                 local change = math.random(1,10)/10
  232.                 cock:getData(self).sizeCoefficient = cock:getData(self).sizeCoefficient + change
  233.                 print(self:GetName().."'s size grew by "..change.." units!")
  234.             elseif(enum == VIAGRA_STAMINA) then
  235.                 if(self:doOnViagraCheck("hiss")) then return end
  236.                 local change = math.random(1,1000)/10
  237.                 cock:getData(self).staminaCoefficient = cock:getData(self).staminaCoefficient + change
  238.                 print(self:GetName().."'s stamina increased by "..change.." units!")
  239.             elseif(enum == VIAGRA_EJACULATION) then
  240.                 if(self:doOnViagraCheck("boom")) then return end
  241.                 local change = math.random(1,50)/10
  242.                 cock:getData(self).ejaculationCoefficient = cock:getData(self).ejaculationCoefficient + change
  243.                 print(self:GetName().."'s ejaculation size increased by "..change.." units!")
  244.             else
  245.                 print(self:GetName().." was fed an unknown pill")
  246.                 self:Die()
  247.                 return
  248.             end
  249.         end
  250.  
  251.         function __self:GetMaxStrokes()
  252.             return cock:getData(self).staminaCoefficient
  253.         end
  254.  
  255.         function __self:ForecastStrokes()
  256.             return cock:getData(self).staminaCoefficient - cock:getData(self).currentStrokes
  257.         end
  258.  
  259.         function __self:Stroke(num)
  260.             if self:doAliveCheck() then return end
  261.             cock:getData(self).currentStrokes = cock:getData(self).currentStrokes + (math.abs(num) or 1)
  262.             print("*rub*")
  263.  
  264.             if(cock:getData(self).currentStrokes >= self:GetMaxStrokes()) then
  265.                 cock:getData(self).currentStrokes = 0
  266.                 print("*throb* *throb* *throb*")
  267.                 print(self:VisualiseEjaculation())
  268.                 print("*splash**splash**splash*")
  269.                 print(self:Visualise())
  270.                 print("*splash**splash**splash*")
  271.                 print(self:VisualiseEjaculation())
  272.                 print("*throb* *throb* *throb*")
  273.                 if(self:GetStateEx()) then cock:getData(self).isErect = false end
  274.                 print("*droop*")
  275.             end
  276.         end
  277.  
  278.         function __self:ShowString()
  279.             return self:Visualise().."\n"..self:tostring()
  280.         end
  281.  
  282.         function __self:Show()
  283.             print(self:Visualise())
  284.             print(self:tostring())
  285.         end
  286.     end
  287.  
  288.     return (function()
  289.         local cock_base = {}
  290.         if not cookie.GetProtected().cockData then
  291.             cookie.GetProtected().cockData = copy(cock.data.base)
  292.             cookie.GetProtected().cockData.length = math.random(math.floor(cock.data.base.range_min*10000),math.floor(cock.data.base.range_max*10000))/10000
  293.         end
  294.         return setmetatable(cock_base,cock.__meta)
  295.     end)()
  296. end
Advertisement
Add Comment
Please, Sign In to add comment