Exemple #1
0
    // Use this for initialization
    void OnEnable()
    {
        PointerHolder pointers = MissionManager.instance.pointers;

        darkness            = pointers.daaaaaknesssss;
        thingsToHide        = new GameObject[3];
        thingsToHide[0]     = pointers.combatant1.healthBar.gameObject;
        thingsToHide[1]     = pointers.ship2.gameObject;
        thingsToHide[2]     = pointers.combatant1.multiplierText.gameObject;
        cameraToDisable     = pointers.camera2;
        cameraToMove        = pointers.camera1.transform;
        shipToMakeNotWiggle = pointers.ship1;
        spaceLightToDisable = pointers.spaceLight;
        cameraToShake       = pointers.spaceCamera.GetComponent <CameraShake>();
        gridToSetup         = pointers.player1Grid;
        escapeParticles     = pointers.ship1.engineParticles;
        pointers.restartButton1.gameObject.SetActive(true);
        pointers.restartButton2.gameObject.SetActive(true);

        narrations[0].gameObject.SetActive(true);
        foreach (GameObject go in thingsToHide)
        {
            go.SetActive(false);
        }
        cameraToDisable.enabled    = false;
        cameraToMove.localPosition = toMoveCameraTo;
        ship = shipToMakeNotWiggle.gameObject;
        spaceLightToDisable.enabled            = false;
        shipToMakeNotWiggle.enabled            = false;
        gridToSetup.player.enemy.damageManager = damageManagerForDoor;

        MissionManager.isInCutscene = true;
    }
    protected virtual void GenerateDeliveries()
    {
        int deliveryCount = 1;
        int newMinValue   = 0;

        if (GameManager.Self.TotalDeliveries > 0)
        {
            deliveryCount += (int)Mathf.Log(Random.Range(GameManager.Self.TotalDeliveries * 0.6f, GameManager.Self.TotalDeliveries), 2);
            newMinValue    = (int)(100 * Mathf.Log(GameManager.Self.TotalDeliveries));
        }
        if (deliveryCount > maximumDeliveryCount)
        {
            deliveryCount = maximumDeliveryCount;
        }

        for (int counter = 0; counter < deliveryCount; counter++)
        {
            Pizza p = new Pizza();
            p.SetRandomValue(minDeliveryValue + newMinValue, minDeliveryValue + 4 * newMinValue);
            p.SelectRandomPlanet();
            GameManager.Self.ActiveDeliveries.Add(p);
            GameManager.Self.playerHUD.AddDeliveryUI(p);
        }
        SpaceshipPawn sp = (SpaceshipPawn)GameManager.Self.player.possessedPawn;

        if (sp)
        {
            sp.SetHasPizza(true);
        }
    }
    // Use this for initialization
    void OnEnable()
    {
        gridAttachedPieces = new GameObject[4];
        PointerHolder p = MissionManager.instance.pointers;

        gridAttachedPieces[0] = p.combatant1.healthBar.gameObject;
        gridAttachedPieces[1] = p.combatant2.healthBar.gameObject;
        gridAttachedPieces[2] = p.combatant2.multiplierText.gameObject;
        gridAttachedPieces[3] = p.player2Grid.transform.Find("NextPieceText").gameObject;
        darkness         = p.daaaaaknesssss;
        gridToSetup      = p.player1Grid;
        gridToTurnIntoAI = p.player2Grid;
        pawnToHide       = p.ship2.stuffToHideIfThisPawnIsDisabledByTheMission;
        pawnToHide.Add(p.ship2.transform.Find("Shield").gameObject);
        tractorBeamLockonSound      = p.ship1.getHitHeavySound;
        damageManagerForTractorBeam = p.combatant2.damageManager;
        cameraToMove      = p.cameraWrapper2.gameObject;
        shipToMakeFlyAway = p.ship1;
        mothershipToMoveIn.GetComponent <DestroySpaceshipOnDeath>().stuffToHide.Add(p.combatant2.multiplierText.GetComponent <SpriteRenderer>());
        mothershipToMoveIn.GetComponent <DestroySpaceshipOnDeath>().stuffToHide.Add(gridAttachedPieces[3].GetComponent <SpriteRenderer>());
        p.restartButton1.gameObject.SetActive(true);
        p.restartButton2.gameObject.SetActive(true);

        narrations[0].gameObject.SetActive(true);
        //gridToSetup.player.enemy.damageManager = damageManagerForDoor;
        MissionManager.isInCutscene = true;
    }
 protected virtual void DeliveryMade()
 {
     if (GameManager.Self.ActiveDeliveries.Count <= 0)
     {
         SpaceshipPawn sp = (SpaceshipPawn)GameManager.Self.player.possessedPawn;
         if (sp)
         {
             sp.SetHasPizza(false);
         }
     }
     GameManager.Self.indicator.RemoveDeliveryZone(this);
     Destroy(gameObject);
 }
Exemple #5
0
    protected virtual void OnTriggerStay2D(Collider2D collision)
    {
        SpaceshipPawn SP = collision.GetComponent <SpaceshipPawn>();

        if (SP)
        {
            GameManager.Self.interactionIndicator.InInteractZone(true);
            if (SP.AbleToInteract)
            {
                HasSuccessfullyInteracted();
            }
        }
    }
    protected virtual void Update()
    {
        if (GameManager.Self.player.possessedPawn && _canInteract)
        {
            SpaceshipPawn sp = GameManager.Self.player.possessedPawn as SpaceshipPawn;
            if (sp)
            {
                if (sp.AbleToInteract)
                {
                    IsInteracting(true);
                }
            }
        }

        if (_interactRemainingTimeOut > 0.0f)
        {
            _interactRemainingTimeOut -= Time.deltaTime;
        }
        else if (_canInteract)
        {
            InInteractZone(false);
        }
    }