Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- wOS.ForcePowers:RegisterNewPower({
- name = "Electric Judgement",
- icon = "EJ",
- description = "The truth can blind us all.",
- image = "wos/forceicons/icefuse/electric_judgement.png",
- cooldown = 0,
- manualaim = false,
- action = function( self )
- if ( self:GetForce() < 5 ) then return end
- local tr = util.TraceLine( util.GetPlayerTrace( self.Owner ) )
- local ent = tr.Entity
- if not ent then return end
- if not ent:IsPlayer() then return end
- if self.Owner:GetPos():Distance( ent:GetPos() ) > 300 then return end
- local ed = EffectData()
- ed:SetOrigin( self:GetSaberPosAng() )
- ed:SetEntity( ent )
- util.Effect( "wos_emerald_lightning", ed, true, true )
- if ent.IsBlocking then
- ent:EmitSound( "lightsaber/saber_hit_laser" .. math.random( 1, 4 ) .. ".wav" )
- if wOS.EnableStamina then
- ent:AddStamina( -5 )
- else
- ent:GetActiveWeapon():SetForce( ent:GetActiveWeapon():GetForce() - 1 )
- end
- ent:SetSequenceOverride( "h_block", 0.5 )
- else
- ent:SetNW2Float( "wOS.DisorientTime", CurTime() + 7 )
- ent:SetNW2Float( "wOS.SaberAttackDelay", CurTime() + 7 )
- end
- self.Owner:SetNW2Float( "wOS.ForceAnim", CurTime() + 0.5 )
- self:SetForce( self:GetForce() - 5 )
- if ( !self.SoundLightning ) then
- self.SoundLightning = CreateSound( self.Owner, "ambient/wind/wind_snippet2.wav" )
- self.SoundLightning:PlayEx( 0.5, 100 )
- else
- self.SoundLightning:PlayEx( 0.5, 100 )
- end
- timer.Create( "test" .. self.Owner:SteamID64(), 0.2, 1, function() if ( self.SoundLightning ) then self.SoundLightning:Stop() self.SoundLightning = nil end end )
- -- self:SetNextAttack( 0.1 )
- return true
- end,
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement