Esempio n. 1
0
    void Gatling(GameObject shooter, int Rarity, int Index, bool isVamp, bool IsReinforce)
    {
        Vector3 scale = Vector3.one;

        if (GameManager.Inst().Player.GetBossMode())
        {
            scale *= 0.5f;
        }
        if (IsReinforce)
        {
            scale *= 1.5f;
        }

        Gatling[] bullets = new Gatling[2];
        for (int i = 0; i < 2; i++)
        {
            Objs[i] = GameManager.Inst().ObjManager.MakeBullet("Gatling", Index);
            Objs[i].transform.position   = GatlingPos[i].transform.position;
            Objs[i].transform.rotation   = GatlingPos[i].transform.rotation;
            Objs[i].transform.localScale = scale;

            bullets[i]             = Objs[i].gameObject.GetComponent <Gatling>();
            bullets[i].IsVamp      = isVamp;
            bullets[i].Vamp        = shooter;
            bullets[i].IsReinforce = IsReinforce;
            bullets[i].Shoot(GatlingPos[i].transform.up);
        }

        GameManager.Inst().SodManager.PlayEffect("Wp_Gatling");
    }
Esempio n. 2
0
        static void Main(string[] args)
        {
            Revolver revolver = new Revolver();
            Rifle    rifle    = new Rifle();
            Shotgun  shotgun  = new Shotgun();
            Gatling  gatling  = new Gatling();

            IWeapon[] soldierWeapons = { revolver, rifle, shotgun, gatling };

            Soldier soldier = new Soldier(soldierWeapons);

            Console.WriteLine("The soldier is trying his weapons: ");
            for (int i = 0; i < soldierWeapons.Length; i++)
            {
                Console.WriteLine(soldier.Shoot(soldierWeapons[i]));
            }

            Console.WriteLine();

            Console.WriteLine("The tank operators are doing some weapon tests: ");

            TankGun    tankGun    = new TankGun();
            MachineGun machineGun = new MachineGun();
            Missile    missile    = new Missile();

            IWeapon[] tankWeapons = { tankGun, machineGun, missile };

            Tank tank = new Tank(tankWeapons);

            for (int i = 0; i < tankWeapons.Length; i++)
            {
                Console.WriteLine(tank.Shoot(tankWeapons[i]));
            }
        }
Esempio n. 3
0
    // le bot souhaite joeur une Gatling
    void PlayGatlingBot(List <int> botHand, List <int> playedThisTurn, int i)
    {
        Gatling g = new Gatling();

        g.PlayBot(botHand[i]);
        playedThisTurn.Add(i);
        Debug.Log("Joue Gatling");
    }
Esempio n. 4
0
        static void Main(string[] args)
        {
            Line();
            Console.WriteLine("Guns & Dependency Inyection");
            Line(); NewLine();

            // 1- Soldado Básico: sólo 1 arma. Inyección de dependiencia con un Arma en el contructor
            Line();
            SoldadoBasico SoldadoRasoAntonioFernandez = new SoldadoBasico(new Phaser("Phaser"), "Antonio Fernández");

            Ataque(SoldadoRasoAntonioFernandez);
            Line(); NewLine();

            // 2- Tanque Multi Gun. Inyección de dependiencia con un Arma en el contructor y en el método ActiveGun
            Line();
            Phaser    PhaserTanqueta = new Phaser("Phaser Tanqueta");
            Laser     LaserTanqueta  = new Laser("Laser Tanqueta");
            Disruptor Disruptor      = new Disruptor("Disruptor Tanqueta");

            TanqueMultiGun TanquetaAcorazada = new TanqueMultiGun(PhaserTanqueta, "Tanqueta 1 división");

            Ataque(TanquetaAcorazada);

            TanquetaAcorazada.ActiveGun(LaserTanqueta);
            Ataque(TanquetaAcorazada);

            TanquetaAcorazada.ActiveGun(Disruptor);
            Ataque(TanquetaAcorazada);

            TanquetaAcorazada.ActiveGun(PhaserTanqueta);
            Ataque(TanquetaAcorazada);
            Line(); NewLine();

            // 3- Soldado Multi Gun con inyección de dependiencia con la ConsoleNotificacition
            Line();
            var       superSoldadoConsoleNotification = new ConsoleNotification();
            Phaser    phaserSuperSoldado    = new Phaser("Phaser SuperSoldado");
            Laser     laserSuperSoldado     = new Laser("Laser SuperSoldado");
            Disruptor disruptorSuperSoldado = new Disruptor("Disruptor SuperSoldado");
            Gatling   gatlingSuperSoldado   = new Gatling("Gatling SuperSoldado");

            SoldadoMultiGun superSoldadoPepeWeller = new SoldadoMultiGun(phaserSuperSoldado, "Pepe Weller", superSoldadoConsoleNotification);

            Ataque(superSoldadoPepeWeller);
            superSoldadoPepeWeller.ActiveGun(laserSuperSoldado, superSoldadoConsoleNotification);
            Ataque(superSoldadoPepeWeller);
            Ataque(superSoldadoPepeWeller);
            superSoldadoPepeWeller.ActiveGun(disruptorSuperSoldado, superSoldadoConsoleNotification);
            superSoldadoPepeWeller.ActiveGun(gatlingSuperSoldado, superSoldadoConsoleNotification);
            Line();
        }