diff options
| author | Alexander Pickering <alexandermpickering@gmail.com> | 2016-04-16 22:30:18 -0400 |
|---|---|---|
| committer | Alexander Pickering <alexandermpickering@gmail.com> | 2016-04-16 22:30:18 -0400 |
| commit | c3bec1047513b8c19eb24fef5f3230486dd17cbd (patch) | |
| tree | 1e20bdf27b743ad4c10553060ac538967f780d41 /gamemode/processes.lua | |
| parent | b16a5f74fc68b34c42c4c201a3f3e1030928bc81 (diff) | |
| download | gmstranded-c3bec1047513b8c19eb24fef5f3230486dd17cbd.tar.gz gmstranded-c3bec1047513b8c19eb24fef5f3230486dd17cbd.tar.bz2 gmstranded-c3bec1047513b8c19eb24fef5f3230486dd17cbd.zip | |
Fixed most recepies not showing up in the structures menu
Diffstat (limited to 'gamemode/processes.lua')
| -rw-r--r-- | gamemode/processes.lua | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/gamemode/processes.lua b/gamemode/processes.lua index 468d03e..41ce61f 100644 --- a/gamemode/processes.lua +++ b/gamemode/processes.lua @@ -18,7 +18,7 @@ hook.Add( "Think", "gms_ProcessThinkHooks", function() local basethink = v:BaseThink() if ( think or basethink or IsStopped ) then - if ( v.Owner and v.Owner != NULL and v.Owner:IsValid() ) then + if ( v.Owner and v.Owner != NULL and v.Owner:IsValid() ) then v.Owner:Freeze( false ) v.Owner:StopProcessBar() v.Owner.InProcess = false @@ -90,7 +90,7 @@ function PlayerMeta:CancelProcess() local v = self.ProcessTable if ( !v.Cancel ) then return end - if ( v.Owner and v.Owner != NULL and IsValid( v.Owner ) ) then + if ( v.Owner and v.Owner != NULL and IsValid( v.Owner ) ) then v.Owner:Freeze( false ) v.Owner:StopProcessBar() v.Owner.InProcess = false @@ -183,8 +183,8 @@ function PROCESS:OnStop() if ( self.SideGain ) then local numto = 1 local numstart = 0 - if ( IsValid( self.Owner:GetActiveWeapon() ) && self.Owner:GetActiveWeapon():GetClass() == "gms_woodenspoon" ) then - numto = numto + 2 + if ( IsValid( self.Owner:GetActiveWeapon() ) && self.Owner:GetActiveWeapon():GetClass() == "gms_woodenspoon" ) then + numto = numto + 2 numstart = numstart + 1 end local num = math.random( numstart, numto ) @@ -249,7 +249,7 @@ function PROCESS:OnStop() elseif ( self.Owner.Hunger >= 900 ) then self.Owner:SetFood( 1000 ) end - + if ( self.Owner.Thirst <= 900 ) then self.Owner:SetThirst( self.Owner.Thirst + 100 ) elseif ( self.Owner.Thirst >= 900 ) then @@ -646,23 +646,23 @@ function PROCESS:OnStop() local num2 = 1 if ( num < self.Data.Chance + self.Owner:GetSkill( "Mining" ) ) then - if ( IsValid( self.Owner:GetActiveWeapon() ) && self.Owner:GetActiveWeapon():GetClass() == "gms_stonepickaxe" ) then + if ( IsValid( self.Owner:GetActiveWeapon() ) && self.Owner:GetActiveWeapon():GetClass() == "gms_stonepickaxe" ) then num2 = math.random( 1, 2 ) - elseif ( IsValid( self.Owner:GetActiveWeapon() ) && self.Owner:GetActiveWeapon():GetClass() == "gms_copperpickaxe" ) then + elseif ( IsValid( self.Owner:GetActiveWeapon() ) && self.Owner:GetActiveWeapon():GetClass() == "gms_copperpickaxe" ) then num2 = math.random( 1, 3 ) - elseif ( IsValid( self.Owner:GetActiveWeapon() ) && self.Owner:GetActiveWeapon():GetClass() == "gms_ironpickaxe" ) then + elseif ( IsValid( self.Owner:GetActiveWeapon() ) && self.Owner:GetActiveWeapon():GetClass() == "gms_ironpickaxe" ) then num2 = math.random( 1, 4 ) - elseif ( IsValid( self.Owner:GetActiveWeapon() ) && self.Owner:GetActiveWeapon():GetClass() == "gms_techpickaxe" ) then + elseif ( IsValid( self.Owner:GetActiveWeapon() ) && self.Owner:GetActiveWeapon():GetClass() == "gms_techpickaxe" ) then num2 = math.random( 1, 5 ) - elseif ( IsValid( self.Owner:GetActiveWeapon() ) && self.Owner:GetActiveWeapon():GetClass() == "gms_silverpickaxe" ) then + elseif ( IsValid( self.Owner:GetActiveWeapon() ) && self.Owner:GetActiveWeapon():GetClass() == "gms_silverpickaxe" ) then num2 = math.random( 1, 6 ) - elseif ( IsValid( self.Owner:GetActiveWeapon() ) && self.Owner:GetActiveWeapon():GetClass() == "gms_goldpickaxe" ) then + elseif ( IsValid( self.Owner:GetActiveWeapon() ) && self.Owner:GetActiveWeapon():GetClass() == "gms_goldpickaxe" ) then num2 = math.random( 1, 7 ) - elseif ( IsValid( self.Owner:GetActiveWeapon() ) && self.Owner:GetActiveWeapon():GetClass() == "gms_steelpickaxe" ) then + elseif ( IsValid( self.Owner:GetActiveWeapon() ) && self.Owner:GetActiveWeapon():GetClass() == "gms_steelpickaxe" ) then num2 = math.random( 1, 8 ) - elseif ( IsValid( self.Owner:GetActiveWeapon() ) && self.Owner:GetActiveWeapon():GetClass() == "gms_platinumpickaxe" ) then + elseif ( IsValid( self.Owner:GetActiveWeapon() ) && self.Owner:GetActiveWeapon():GetClass() == "gms_platinumpickaxe" ) then num2 = math.random( 1, 9 ) - elseif ( IsValid( self.Owner:GetActiveWeapon() ) && self.Owner:GetActiveWeapon():GetClass() == "gms_pickaxeofdjarex" ) then + elseif ( IsValid( self.Owner:GetActiveWeapon() ) && self.Owner:GetActiveWeapon():GetClass() == "gms_pickaxeofdjarex" ) then num2 = math.random( 85, 85 ) elseif ( IsValid( self.Owner:GetActiveWeapon() ) && self.Owner:GetActiveWeapon():GetClass() == "gms_mithrilpickaxe" ) then num2 = math.random( 1, 10 ) @@ -675,7 +675,7 @@ function PROCESS:OnStop() elseif ( IsValid( self.Owner:GetActiveWeapon() ) && self.Owner:GetActiveWeapon():GetClass() == "gms_runewpickaxe" ) then num2 = math.random( 1, 8 ) end - + local num3 = math.random( self.Data.MinAmount, self.Data.MaxAmount ) @@ -703,7 +703,7 @@ function PROCESS:OnStop() elseif ( num2 == 8 ) then self.Owner:IncResource( "Platinum_Ore", num3 ) self.Owner:SendMessage( "Platinum Ore ( " .. num3 .. "x )", 3, Color( 10, 200, 10, 255 ) ) - elseif ( num2 == 85 ) then + elseif ( num2 == 85 ) then self.Owner:IncResource( "Strange_Stone", num3 ) self.Owner:SendMessage( "Strange Stone ( " .. num3 .. "x ) ", 3, Color( 0, 247, 255, 255) ) elseif ( num2 == 9 ) then @@ -712,7 +712,7 @@ function PROCESS:OnStop() elseif ( num2 == 10) then self.Owner:IncResource( "Adamantine_Ore", num3 ) self.Owner:SendMessage( "Adamantine Ore( " .. num3 .. "x ) ", 3, Color(255,0, 111, 255) ) - end + end self.Owner:IncXP( "Mining", math.Clamp( math.Round( 50 / self.Owner:GetSkill( "Mining" ) ), 1, 1000 ) ) self.Owner:EmitSound( Sound( "items/ammo_pickup.wav" ) ) @@ -928,7 +928,7 @@ end function PROCESS:OnStop() local num = math.random( 1, 100 ) - + if ( !self.Owner.Resources['Baits'] or self.Owner.Resources['Baits'] < 1 ) then self.Data.Chance = self.Data.Chance * 0.25 end @@ -937,7 +937,7 @@ function PROCESS:OnStop() if ( self.Owner.Resources['Baits'] and self.Owner.Resources['Baits'] > 0 ) then self.Owner:DecResource( "Baits", 1 ) end - + if ( num < ( self.Data.Chance + self.Owner:GetSkill( "Fishing" ) ) / 1.5 ) then self.Owner:IncResource( "Bass", 1 ) self.Owner:SendMessage( "Bass ( 1x )", 3, Color( 10, 200, 10, 255 ) ) @@ -974,12 +974,12 @@ function PROCESS:OnStop() if ( !self.Owner.Resources['Baits'] or self.Owner.Resources['Baits'] < 1 ) then self.Data.Chance = self.Data.Chance * 0.25 end - + if ( num < self.Data.Chance + self.Owner:GetSkill( "Fishing" ) ) then if ( self.Owner.Resources['Baits'] and self.Owner.Resources['Baits'] > 0 ) then self.Owner:DecResource( "Baits", 1 ) end - + if ( num < ( self.Data.Chance + self.Owner:GetSkill( "Fishing" ) ) / 2 ) then self.Owner:IncResource( "Bass", 1 ) self.Owner:SendMessage( "Bass ( 1x )", 3, Color( 10, 200, 10, 255 ) ) @@ -1068,7 +1068,7 @@ GMS.RegisterProcess( "DrinkBottle", PROCESS ) local PROCESS = {} function PROCESS:OnStart() - if ( self.Owner:Health() >= 200 or ( self.Owner:Health() >= 150 and self.Owner:HasUnlock( "Master_Survivalist" ) != true ) or ( self.Owner:Health() >= 100 and self.Owner:HasUnlock( "Adept_Survivalist" ) != true ) ) then + if ( self.Owner:Health() >= 200 or ( self.Owner:Health() >= 150 and self.Owner:HasUnlock( "Master_Survivalist" ) != true ) or ( self.Owner:Health() >= 100 and self.Owner:HasUnlock( "Adept_Survivalist" ) != true ) ) then self.Owner:SendMessage( "You're feeling good, why would you heal yourself.", 3, Color( 200, 0, 0, 255 ) ) else self.Owner:MakeProcessBar( "Taking Medicine", self.Time, self.Cancel ) @@ -1077,7 +1077,7 @@ function PROCESS:OnStart() end function PROCESS:OnStop() - if ( self.Owner:Health() >= 200 or ( self.Owner:Health() >= 150 and self.Owner:HasUnlock( "Master_Survivalist" ) != true ) or ( self.Owner:Health() >= 100 and self.Owner:HasUnlock( "Adept_Survivalist" ) != true ) ) then return end + if ( self.Owner:Health() >= 200 or ( self.Owner:Health() >= 150 and self.Owner:HasUnlock( "Master_Survivalist" ) != true ) or ( self.Owner:Health() >= 100 and self.Owner:HasUnlock( "Adept_Survivalist" ) != true ) ) then return end self.Owner:DecResource( "Medicine", 1 ) self.Owner:SendMessage( "You're feeling a bit better now.", 3, Color( 10, 200, 10, 255 ) ) self.Owner:Heal( 10 ) |
