public void ExplorationResult()
 {
     state = PortalStatus.Contacted;
     ticksUntilExplored = 0;
     innerContainer.TryDropAll(this.PositionHeld, this.MapHeld, ThingPlaceMode.Near);
     Messages.Message("ROM_PortalExplored".Translate(), MessageSound.Standard);
 }
    // Use this for initialization
    new void Start()
    {
        status          = PortalStatus.on;
        collRef         = MeshRef.GetComponent <Collider> ();
        collRef.enabled = true;
        Vector4 newColor = new Vector4(1.0f, 1.0f, 1.0f, 1.0f);

        matRef.color = newColor;
    }
Esempio n. 3
0
        public static int AsHue(this PortalStatus status)
        {
            switch (status)
            {
            case PortalStatus.Running:
                return(63);

            case PortalStatus.Finished:
                return(137);

            default:
                return(0);
            }
        }
    // Update is called once per frame
    new void Update()
    {
        Vector2 off = new Vector2(0.0f, vOffset);

        matRef.mainTextureOffset = off;

        vOffset += vSpeed * Time.deltaTime;

        if (status == PortalStatus.fadingOut)
        {
            opacity -= opacitySpeed * Time.deltaTime;
            if (opacity < 0.0f)
            {
                opacity         = 0.0f;
                status          = PortalStatus.off;
                collRef.enabled = false;
            }

            Vector4 newColor = new Vector4(1.0f, 1.0f, 1.0f, opacity);
            matRef.color = newColor;
        }
    }
        public override IEnumerable <Gizmo> GetGizmos()
        {
            foreach (Gizmo g in base.GetGizmos())
            {
                yield return(g);
            }

            if (state <= PortalStatus.Open)
            {
                yield return new Command_Toggle
                       {
                           defaultLabel = "ROM_PortalOpen".Translate(),
                           defaultDesc  = "ROM_PortalOpenDesc".Translate(),
                           isActive     = () => workerNeeded,
                           toggleAction = delegate
                           {
                               workerNeeded = !workerNeeded;
                               state        = (workerNeeded) ? PortalStatus.Opening : PortalStatus.Closed;
                           }
                       }
            }
            ;
            if (state >= PortalStatus.Closing && state < PortalStatus.Contacted)
            {
                yield return(new Command_Toggle
                {
                    defaultLabel = "ROM_PortalClose".Translate(),
                    defaultDesc = "ROM_PortalCloseDesc".Translate(),
                    isActive = () => workerNeeded,
                    toggleAction = delegate
                    {
                        workerNeeded = !workerNeeded;
                        state = (workerNeeded) ? PortalStatus.Closing : PortalStatus.Open;
                    }
                });
            }
        }
Esempio n. 6
0
    // Update is called once per frame
    void Update()
    {
        if (GameDataManager.Instance != null)
        {
            if (!GameDataManager.Instance.HasFlag(ProgressionFlags.TowerUnlock))
            {
                if (cachedPortalStatus != PortalStatus.NoTower)
                {
                    cachedPortalStatus    = PortalStatus.NoTower;
                    portalStatusArea.text = strings[6];
                }
                if (cachedPortalNextSteps != PortalNextSteps.NoTower)
                {
                    cachedPortalNextSteps    = PortalNextSteps.NoTower;
                    portalNextStepsArea.text = strings[12];
                }
                if (matsNeededSection.activeInHierarchy)
                {
                    matsNeededSection.SetActive(false);
                }
            }
            else
            {
                if (GameDataManager.Instance.dataStore.buildingLv_WizardsTower == 10)
                {
                    if (matsNeededSection.activeInHierarchy)
                    {
                        matsNeededSection.SetActive(false);
                    }
                }
                else if (!matsNeededSection.activeInHierarchy)
                {
                    matsNeededSection.SetActive(true);
                }
                switch (GameDataManager.Instance.dataStore.buildingLv_WizardsTower)
                {
                case 1:
                    if (cachedPortalStatus != PortalStatus.TowerLv1)
                    {
                        cachedPortalStatus    = PortalStatus.TowerLv1;
                        portalStatusArea.text = strings[7];
                    }
                    _in_UpdateProcessing_PortalArea_preLv7();
                    break;

                case 2:
                case 3:
                    if (cachedPortalStatus != PortalStatus.TowerLv2)
                    {
                        cachedPortalStatus    = PortalStatus.TowerLv2;
                        portalStatusArea.text = strings[8];
                    }
                    _in_UpdateProcessing_PortalArea_preLv7();
                    break;

                case 4:
                case 5:
                case 6:
                    if (cachedPortalStatus != PortalStatus.TowerLv4)
                    {
                        cachedPortalStatus    = PortalStatus.TowerLv4;
                        portalStatusArea.text = strings[9];
                    }
                    _in_UpdateProcessing_PortalArea_preLv7();
                    break;

                case 7:
                case 8:
                case 9:
                    if (cachedPortalStatus != PortalStatus.TowerLv7)
                    {
                        cachedPortalStatus    = PortalStatus.TowerLv7;
                        portalStatusArea.text = strings[10];
                    }
                    _in_UpdateProcessing_PortalArea_postLv7();
                    break;

                case 10:
                    if (cachedPortalStatus != PortalStatus.TowerLv10)
                    {
                        cachedPortalStatus    = PortalStatus.TowerLv10;
                        portalStatusArea.text = strings[11];
                    }
                    if (cachedPortalNextSteps != PortalNextSteps.TowerDone)
                    {
                        cachedPortalNextSteps    = PortalNextSteps.TowerDone;
                        portalNextStepsArea.text = strings[20];
                    }
                    break;
                }
            }
        }
    }
 public void _wm_disable()
 {
     status = PortalStatus.fadingOut;
 }
 public void Notify_Closed(Pawn actor)
 {
     workerNeeded = false;
     state        = PortalStatus.Closed;
     Messages.Message("ROM_PortalCloseMess".Translate(actor.LabelShort), MessageSound.Standard);
 }