public static GameObject sniper(Vector3 position, Transform team, float health)
        {
            GameObject gmbjct = SimpleMob(position, team, health);
            AI         aivars = gmbjct.SearchComponent <AI>();


            aivars.AddAttacks(WeaponsStaticClass.ball);
            BallChargeAttack ball = gmbjct.SearchComponent <BallChargeAttack>();

            ball.CanPassThroughBodies = false;
            ball.Reach   = 30f;
            ball.MaxSize = 1f;
            ball.Speed   = 60f;
            aivars.AssignModeScript <BallCharge_AttackMode>();

            return(gmbjct);
        }
    private GameObject SpawnNpc(Transform[] fightersgroup)
    {
        GameObject temp    = null;
        int        teamnum = 0;

        for (int i = 0; i < _characters.Length; i++)
        {
            if (_characters[i] == fightersgroup)
            {
                temp    = BasicLib.InstantiatePrefabGmbjct("mobs/npc", MyColorLib.teams[i].transform);
                teamnum = i;
                break;
            }
        }
        LifeComponent        life          = temp.SearchComponent <LifeComponent>();
        AI                   aivars        = temp.SearchComponent <AI>();
        BaseCharacterControl vars          = temp.GetCharacter();
        MoveComponent        MoveComponent = temp.SearchComponent <MoveComponent>();

        //MoveComponent.speed = 10f;

        MoveComponent.SetPosition(_centreSpawns[teamnum] + new Vector3(Random.Range(-10f, 10f), Random.Range(-10f, 10f)));
        aivars.SearchComponent <MoveAround_ChillMode>().CentrePosition = Vector3.zero;

        /*
         * foreach (Transform[] otherteam in fighters)
         * {
         *  if (otherteam != fightersgroup)
         *  {
         *      rules.addToCandoAndToOthers(otherteam, MoveComponent.transform, true, true);
         *  }
         * }
         */

        int rand = Random.Range(0, 5);

        if (rand == 0)
        {
            aivars.AddAttacks(new int[] { WeaponsStaticClass.fire });
            temp.AddComponent <AttackFromDistance_AttackMode>();
        }
        else if (rand == 1)
        {
            aivars.AddAttacks(new int[] { WeaponsStaticClass.ball });
            temp.AddComponent <BallCharge_AttackMode>();
        }
        else if (rand == 2)
        {
            aivars.AddAttacks(new int[] { WeaponsStaticClass.spray });
            temp.AddComponent <AttackFromDistance_AttackMode>();
        }
        else if (rand == 3)
        {
            aivars.AddAttacks(new int[] { WeaponsStaticClass.ball });
            BallChargeAttack ball = temp.SearchComponent <BallChargeAttack>();
            ball.Reach   = 30f;
            ball.MaxSize = 1f;
            ball.Speed   = 60f;
            temp.AddComponent <BallCharge_AttackMode>();
        }
        else if (rand == 4)
        {
            aivars.AddAttacks(WeaponsStaticClass.shield).SearchComponent <Shield>().SetUpAI();
        }
        return(temp);
    }
Example #3
0
 public BallChargeState(AttackStateMachine ASM, BallChargeAttack ballCharge) : base(ASM)
 {
     _ballCharge = ballCharge;
 }
Example #4
0
 public BallThrownState(AttackStateMachine ASM, BallChargeAttack ballCharge) : base(ASM, ballCharge)
 {
 }
Example #5
0
 public ChargingState(AttackStateMachine ASM, BallChargeAttack ballCharge) : base(ASM, ballCharge)
 {
 }
Example #6
0
 protected new void Awake()
 {
     base.Awake();
     _ballAttack = this.SearchComponent <BallChargeAttack>();
 }