Esempio n. 1
0
 public void Clear()
 {
     if (cooldown)
     {
         return;
     }
     NukeInteract.Clear();
     CodeDisplay.SetValue = "";
 }
    public void CmdInputNukeCode(GameObject nuke, string code)
    {
        NukeInteract nukeScript = nuke.GetComponent <NukeInteract>();

        if (nukeScript != null)
        {
            nukeScript.Validate(code);
        }
    }
Esempio n. 3
0
 public void EnterDigit(char digit)
 {
     if (cooldown)
     {
         return;
     }
     if (NukeInteract.AppendKey(digit))
     {
         int length = NukeInteract.CurrentCode.Length;
         //replace older digits with asterisks
         string newDigit = NukeInteract.CurrentCode.Substring(length <= 0 ? 0 : length - 1);
         CodeDisplay.SetValue = newDigit.PadLeft(length, '*');
         StartCoroutine(HideCode());
     }
 }
Esempio n. 4
0
    public void TryArm()
    {
        if (cooldown)
        {
            return;
        }

        if (NukeInteract.Validate())
        {
            InfoDisplay.SetValue = "PREPARE TO DIE";
        }
        else
        {
            StartCoroutine(ErrorCooldown());
        }
    }
Esempio n. 5
0
    public IEnumerator SetPlayerLoadOuts()
    {
        //Waiting for player name resolve
        yield return(WaitUntilInControl());

        // Null Job players dont get a loadout
        if (playerScript.JobType == JobType.NULL)
        {
            yield break;
        }

        PlayerScript pS = GetComponent <PlayerScript>();

        pS.JobType = playerScript.JobType;

        JobOutfit standardOutfit = GameManager.Instance.StandardOutfit.GetComponent <JobOutfit>();
        JobOutfit jobOutfit      = GameManager.Instance.GetOccupationOutfit(playerScript.JobType);

        Dictionary <string, string> gear = new Dictionary <string, string>();

        gear.Add("uniform", standardOutfit.uniform);
        gear.Add("ears", standardOutfit.ears);
        gear.Add("belt", standardOutfit.belt);
        gear.Add("back", standardOutfit.backpack);
        gear.Add("shoes", standardOutfit.shoes);
        gear.Add("glasses", standardOutfit.glasses);
        gear.Add("gloves", standardOutfit.gloves);
        gear.Add("suit", standardOutfit.suit);
        gear.Add("head", standardOutfit.head);
        //gear.Add("accessory", standardOutfit.accessory);
        gear.Add("mask", standardOutfit.mask);
        //gear.Add("backpack", standardOutfit.backpack);
        //gear.Add("satchel", standardOutfit.satchel);
        //gear.Add("duffelbag", standardOutfit.duffelbag);
        //gear.Add("box", standardOutfit.box);
        //gear.Add("l_hand", standardOutfit.l_hand);
        //gear.Add("l_pocket", standardOutfit.l_pocket);
        //gear.Add("r_pocket", standardOutfit.r_pocket);
        //gear.Add("suit_store", standardOutfit.suit_store);

        if (!string.IsNullOrEmpty(jobOutfit.uniform))
        {
            gear["uniform"] = jobOutfit.uniform;
        }

        /*if (!String.IsNullOrEmpty(jobOutfit.id))
         *      gear["id"] = jobOutfit.id;*/
        if (!string.IsNullOrEmpty(jobOutfit.ears))
        {
            gear["ears"] = jobOutfit.ears;
        }
        if (!string.IsNullOrEmpty(jobOutfit.belt))
        {
            gear["belt"] = jobOutfit.belt;
        }
        if (!string.IsNullOrEmpty(jobOutfit.backpack))
        {
            gear["back"] = jobOutfit.backpack;
        }
        if (!string.IsNullOrEmpty(jobOutfit.shoes))
        {
            gear["shoes"] = jobOutfit.shoes;
        }
        if (!string.IsNullOrEmpty(jobOutfit.glasses))
        {
            gear["glasses"] = jobOutfit.glasses;
        }
        if (!string.IsNullOrEmpty(jobOutfit.gloves))
        {
            gear["gloves"] = jobOutfit.gloves;
        }
        if (!string.IsNullOrEmpty(jobOutfit.suit))
        {
            gear["suit"] = jobOutfit.suit;
        }
        if (!string.IsNullOrEmpty(jobOutfit.head))
        {
            gear["head"] = jobOutfit.head;
        }

        /*if (!String.IsNullOrEmpty(jobOutfit.accessory))
         *      gear["accessory"] = jobOutfit.accessory;*/
        if (!string.IsNullOrEmpty(jobOutfit.mask))
        {
            gear["mask"] = jobOutfit.mask;
        }

        /*if (!String.IsNullOrEmpty(jobOutfit.backpack))
         *      gear["backpack"] = jobOutfit.backpack;
         * if (!String.IsNullOrEmpty(jobOutfit.satchel))
         *      gear["satchel"] = jobOutfit.satchel;
         * if (!String.IsNullOrEmpty(jobOutfit.duffelbag))
         *      gear["duffelbag"] = jobOutfit.duffelbag;
         * if (!String.IsNullOrEmpty(jobOutfit.box))
         *      gear["box"] = jobOutfit.box;
         * if (!String.IsNullOrEmpty(jobOutfit.l_hand))
         *      gear["l_hand"] = jobOutfit.l_hand;
         * if (!String.IsNullOrEmpty(jobOutfit.l_pocket))
         *      gear["l_pocket"] = jobOutfit.l_pocket;
         * if (!String.IsNullOrEmpty(jobOutfit.r_pocket))
         *      gear["r_pocket"] = jobOutfit.r_pocket;
         * if (!String.IsNullOrEmpty(jobOutfit.suit_store))
         *      gear["suit_store"] = jobOutfit.suit_store;*/

        foreach (KeyValuePair <string, string> gearItem in gear)
        {
            if (gearItem.Value.Contains(UniItemUtils.ClothingHierIdentifier) || gearItem.Value.Contains(UniItemUtils.HeadsetHierIdentifier) ||
                gearItem.Value.Contains(UniItemUtils.BackPackHierIdentifier) || gearItem.Value.Contains(UniItemUtils.BagHierIdentifier))
            {
                GameObject obj = ClothFactory.CreateCloth(gearItem.Value, TransformState.HiddenPos, transform.parent);
                //if ClothFactory does not return an object then move on to the next clothing item
                if (!obj)
                {
                    Logger.LogWarning("Trying to instantiate clothing item " + gearItem.Value + " failed!", Category.Equipment);
                    continue;
                }
                ItemAttributes itemAtts = obj.GetComponent <ItemAttributes>();
                SetItem(GetLoadOutEventName(gearItem.Key), itemAtts.gameObject);
            }
            else if (!string.IsNullOrEmpty(gearItem.Value))
            {
                //					Logger.Log(gearItem.Value + " creation not implemented yet.");
            }
        }
        SpawnID(jobOutfit);

        yield return(new WaitForSeconds(3f));        //Wait a bit for headset to be fully setup and player to be fully spawned.

        if (playerScript.JobType == JobType.SYNDICATE)
        {
            //Check to see if there is a nuke and communicate the nuke code:
            NukeInteract nuke = FindObjectOfType <NukeInteract>();
            if (nuke != null)
            {
                UpdateChatMessage.Send(gameObject, ChatChannel.Syndicate,
                                       "We have intercepted the code for the nuclear weapon: " + nuke.NukeCode);
            }
        }
    }