/*
 * This file is part of the Turtle project
 *
 * (c) 2011 Julien Brochet <julien.brochet@etu.univ-lyon1.fr>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

package turtle.behavior.team;

import turtle.entity.Team;
import turtle.entity.field.Field;
import turtle.util.Random;
import turtle.util.geom.Vector2D;

/**
 * Comportement agressif d'une équipe
 *
 * @author Julien Brochet <julien.brochet@etu.univ-lyon1.fr>
 * @since 1.0
 */
public class Aggressive extends AbstractTeamBehavior
{
    public Aggressive(Field field, Team team)
    {
        super(field, team);
    }

    @Override
    public void apply(Vector2D vector, long elapsedTime)
    {
        // Augmentation de la vitesse mais perte de précision
        vector.scale(Random.between(1.05, 1.5));
        vector.rotate(Random.between(-1, +1));
    }
}

@@ -297,16 +297,78 @@
 y.Team;%0A
+import turtle.entity.Turtle;%0Aimport turtle.entity.field.Ball;%0A
 import t
@@ -393,16 +393,16 @@
 .Field;%0A
-
 import t
@@ -790,32 +790,382 @@
 psedTime)%0A    %7B%0A
+        Ball ball = mField.getBall();%0A        Turtle lastShooter = (Turtle) ball.getLastShooter();%0A%0A        if (lastShooter != null && lastShooter.getTeam() == mTeam) %7B%0A            // Le ballon a %C3%A9t%C3%A9 tir%C3%A9 par l'%C3%A9quipe du joueur%0A            Vector2D speed = ball.getSpeedVector();%0A            speed.rotate(Random.degreesToRadians(-3, +3));%0A        %7D%0A%0A
         // Augme
@@ -1252,10 +1252,9 @@
 n(1.
-05
+2
 , 1.

tweak Aggressive behavior