Esempio n. 1
0
    protected override void UseSpecial()
    {
        if (this.SpecialAmmo > 0)
        {
            this.PlayThrowLightSound(0.4f);
            this.SpecialAmmo--;
            gunSprite.GetComponent <Renderer>().material.mainTexture = gunTextureNoShield;
            if (base.IsMine)
            {
                //Main.Log("spawning");
                //ProjectileController.SpawnProjectileOverNetwork(this.boomerang, this, base.X + base.transform.localScale.x * 6f, base.Y + 15f, base.transform.localScale.x * this.boomerangSpeed, 0f, false, base.playerNum, false, false, 0f);
                Shield newProj = ProjectileController.SpawnProjectileLocally(this.shield, this, base.X + base.transform.localScale.x * 6f, base.Y + 8, base.transform.localScale.x * this.boomerangSpeed, 0f, false, base.playerNum, false, false, 0f) as Shield;
                //newProj.Display();
                //Main.Log("arguments: " + (base.X + base.transform.localScale.x * 6f) + "   " + (base.Y + 8) + "   " + (base.transform.localScale.x * this.boomerangSpeed) + "   " + 0f);
                //shield.gameObject.SetActive(true);
                //shield.Fire(base.X + base.transform.localScale.x * 6f, base.Y + 8, base.transform.localScale.x * this.boomerangSpeed, 0f, 0f, base.playerNum, this);

                //shield.gameObject.SetActive
                BoxCollider tempAttachBoxCollider = BoxCollider.Instantiate(attachBoxCollider);
                //Transform tempShieldTransform = Transform.Instantiate(shieldTransform);
                Transform   tempShieldTransform = newProj.transform;
                SoundHolder tempSoundHolder     = SoundHolder.Instantiate(boomerangSoundHolder);

                newProj.Setup(tempAttachBoxCollider, tempShieldTransform, tempSoundHolder, rotationSpeed, true);
                newProj.activeProjectile = true;
                //Main.Log("spawned");
            }
        }
        else
        {
            HeroController.FlashSpecialAmmo(base.playerNum);
            this.ActivateGun();
        }
        this.pressSpecialFacingDirection = 0;
    }