function Create(self)
    --Chance of flickering each frame.
    self.flickerChance = 0.9;
    
    --Number of damage pulses to go through before stopping.
    self.maxPulses = 10;
    
    --Length of time between pulses of damage.
    self.damageTime = 300;
    
    --Speed of a damage particle.
    self.damageSpeed = 100;
    
    --Current number of damage pulses.
    self.pulses = 0;
    
    --Timer for damage.
    self.damageTimer = Timer();
    
    --Get the target from Sharpness.
    self.target = MovableMan:GetMOFromID(self.Sharpness);
    
    --Offset information.
    self.Pos = self.Pos + self.Vel * TimerMan.DeltaTimeSecs * 20;
    self.targetOffset = SceneMan:ShortestDistance(self.target.Pos, self.Pos, true);
    self.hitAngle = self.target.RotAngle;
    
    self:EnableEmission(true);
end

function Update(self)
    if self.target ~= nil and self.target.ID ~= 255 then
        self.Pos = self.target.Pos + Vector(self.targetOffset.X, self.targetOffset.Y):RadRotate(self.target.RotAngle - self.hitAngle);
        
        --Flicker.
        if math.random() <= self.flickerChance then
            local flicker = CreateMOPixel("Techion.rte/Nanobot Flicker");
            flicker.Pos = self.Pos + Vector(self.target.Radius * 0.7, 0):RadRotate(2 * math.pi * math.random());
            flicker.Vel = Vector(1, 0):RadRotate(2 * math.pi * math.random());
            MovableMan:AddParticle(flicker);
        end
        
        --Cause damage.
        if self.damageTimer:IsPastSimMS(self.damageTime) then
            local damage = CreateMOPixel("Techion.rte/Nanobot Damage");
            damage.Pos = self.Pos;
            damage.Vel = Vector(self.damageSpeed, 0):RadRotate(2 * math.pi * math.random());
            MovableMan:AddParticle(damage);
            
            self.pulses = self.pulses + 1;
            self.damageTimer:Reset();
        end
    else
        self:GibThis();
    end
    
    if self.pulses > self.maxPulses then
        self.ToDelete = true;
    end
end