Ejemplo n.º 1
0
 private void Awake()
 {
     rb   = GetComponent <Rigidbody>();
     pm   = GameObject.Find("Duck").GetComponent <PlayerMovement>();
     dnc  = GameObject.Find("Sun").GetComponent <DayNightCycle>();
     ft   = GameObject.Find("FlavorTextUpper").GetComponent <FlavorText>();
     ren  = GetComponent <Renderer>();
     aud  = GameObject.Find("AudioController").GetComponent <AudioSource>();
     clip = (AudioClip)Resources.Load("Sound Effects/DragonBiteL");
 }
Ejemplo n.º 2
0
        private static void SetFlavor(int iteration, IDictionary <string, List <FlavorText> > map, RecipeSpec spec)
        {
            FlavorText flavor          = null;
            var        ingredientNames = spec.Ingredients.Select(i => i.Name).ToHashSet();

            foreach (var ing in spec.Ingredients)
            {
                List <FlavorText> list;
                if (!map.TryGetValue(ing.Name.ToLower(), out list))
                {
                    continue;
                }

                flavor = list.FirstOrDefault(f => f.Ingredients.All(i => ingredientNames.Contains(i)));
                if (flavor == null)
                {
                    continue;
                }

                list.Remove(flavor);
                break;
            }

            if (flavor != null)
            {
                spec.Label              = $"Make {flavor.Name}";
                spec.ProductLabel       = flavor.Name;
                spec.Description        = flavor.Description;
                spec.ProductDescription = flavor.Description;

                return;
            }

            spec.Label        = $"Make {spec.Ingredients.First().Label} Meal No. {iteration}";
            spec.ProductLabel = $"{spec.Ingredients.First().Label} Meal No. {iteration}";

            var description = new StringBuilder("A meal made of");

            for (int i = 0; i < spec.Ingredients.Count - 1; i++)
            {
                description.Append($" {spec.Ingredients[i].Label},");
            }

            if (spec.Ingredients.Count == 2)
            {
                description = description.Replace(",", "");
            }

            description.Append(spec.Ingredients.Count > 1
                ? $" and {spec.Ingredients[spec.Ingredients.Count - 1].Label}."
                : $" {spec.Ingredients[spec.Ingredients.Count - 1].Label}.");

            spec.Description        = description.ToString();
            spec.ProductDescription = spec.Description;
        }
Ejemplo n.º 3
0
 public void ConvertGalarToNational(List <GalarPokemon> galardex)
 {
     foreach (GalarPokemon poke in galardex)
     {
         PokemonData data = new PokemonData();
         data.id = poke.id;
         data.N  = poke.name.ToLower();
         List <StatsData> stats = new List <StatsData>();
         foreach (int stat in poke.base_stats)
         {
             StatsData statdata = new StatsData();
             statdata.bs = stat;
             stats.Add(statdata);
         }
         data.St = stats;
         List <AbilityData> abs = new List <AbilityData>();
         foreach (string ab in poke.abilities)
         {
             if (!abs.Exists(a => a.n == ab))
             {
                 AbilityData a = new AbilityData();
                 a.n = ab;
                 if (ab == poke.abilities.Last())
                 {
                     a.isH = true;
                 }
                 else
                 {
                     a.isH = false;
                 }
                 abs.Add(a);
             }
         }
         data.Ab = abs;
         List <TypeData> types = new List <TypeData>();
         for (int i = 0; i < poke.types.Count(); i++)
         {
             TypeData t = new TypeData();
             t.n = poke.types[i];
             t.n = t.n.ToLower();
             types.Add(t);
         }
         data.T = types;
         PokeSpecieData    info = new PokeSpecieData();
         FlavorText        fte  = new FlavorText();
         List <FlavorText> ftes = new List <FlavorText>();
         fte.v = "SW/SH";
         fte.e = poke.description;
         ftes.Add(fte);
         info.FTE  = ftes;
         data.info = info;
         pokemon.Add(data);
     }
 }
Ejemplo n.º 4
0
    private void Awake()
    {
        SceneManager.sceneLoaded += OnSceneLoaded;
        DontDestroyOnLoad(gameObject);

        string filePath = Path.Combine(Application.streamingAssetsPath, flavorTextJson);

        if (File.Exists(filePath))
        {
            string dataAsJson = File.ReadAllText(filePath);
            flavorText = JsonUtility.FromJson <FlavorText>(dataAsJson);
        }
        else
        {
            print("no flavor text data!");
        }
    }
Ejemplo n.º 5
0
    private void Awake()
    {
        // Get various object components.
        sunCounter = GameObject.Find("SunCounter").GetComponent <Text>();
        mp         = GameObject.Find("Playlist").GetComponent <MusicPlayer>();
        ft         = GameObject.Find("FlavorText").GetComponent <FlavorText>();
        ft2        = GameObject.Find("FlavorTextUpper").GetComponent <FlavorText>();
        lt         = GetComponent <Light>();
        // Set the skybox and ambient light to their default settings.
        RenderSettings.skybox.SetColor("_Tint", Color.white);
        //RenderSettings.ambientLight = Color.blue;
        //RenderSettings.ambientIntensity = 1.0f;
        RenderSettings.ambientIntensity = 0.0f;

        // Set the time to its initial value at the start of the game.
        time           = timeForNight;
        aud            = GameObject.Find("AudioController").GetComponent <AudioSource>();
        poweron        = (AudioClip)Resources.Load("Sound Effects/EMotorDoor");
        poweroff       = (AudioClip)Resources.Load("Sound Effects/Power Down");
        powerCubeSound = (AudioClip)Resources.Load("Sound Effects/electriccurrent");
    }
    private void Start()
    {
        // Find the main camera and store a reference to it in myCamera.
        myCamera = GameObject.Find("MainCamera");
        // Get the Rigibody component and store it in rb.
        rb = GetComponent <Rigidbody>();
        // Do this for the camera's MouseAimCamera component as well.
        mac = myCamera.GetComponent <MouseAimCamera>();
#if CHEATS
        dnc = GameObject.Find("Sun").GetComponent <DayNightCycle>();
#endif
        hptext        = GameObject.Find("HPCounter").GetComponent <Text>();
        ft2           = GameObject.Find("FlavorTextUpper").GetComponent <FlavorText>();
        aud           = GameObject.Find("AudioController").GetComponent <AudioSource>();
        myaud         = GetComponent <AudioSource>();
        ouch          = (AudioClip)Resources.Load("Sound Effects/Yeouch");
        jump          = 2 * Vector3.up;
        spottedPlayer = (AudioClip)Resources.Load("Sound Effects/AirHorn");
        greenscript   = (GameObject)Resources.Load("Prefabs/GreenScript");
        canvas        = GameObject.Find("HUDCanvas");

        UpdateHPText();
    }
Ejemplo n.º 7
0
        public bool Equals(DestinyInventoryItemDefinition input)
        {
            if (input == null)
            {
                return(false);
            }

            return
                ((
                     DisplayProperties == input.DisplayProperties ||
                     (DisplayProperties != null && DisplayProperties.Equals(input.DisplayProperties))
                     ) &&
                 (
                     TooltipNotifications == input.TooltipNotifications ||
                     (TooltipNotifications != null && TooltipNotifications.SequenceEqual(input.TooltipNotifications))
                 ) &&
                 (
                     CollectibleHash == input.CollectibleHash ||
                     (CollectibleHash.Equals(input.CollectibleHash))
                 ) &&
                 (
                     IconWatermark == input.IconWatermark ||
                     (IconWatermark != null && IconWatermark.Equals(input.IconWatermark))
                 ) &&
                 (
                     IconWatermarkShelved == input.IconWatermarkShelved ||
                     (IconWatermarkShelved != null && IconWatermarkShelved.Equals(input.IconWatermarkShelved))
                 ) &&
                 (
                     SecondaryIcon == input.SecondaryIcon ||
                     (SecondaryIcon != null && SecondaryIcon.Equals(input.SecondaryIcon))
                 ) &&
                 (
                     SecondaryOverlay == input.SecondaryOverlay ||
                     (SecondaryOverlay != null && SecondaryOverlay.Equals(input.SecondaryOverlay))
                 ) &&
                 (
                     SecondarySpecial == input.SecondarySpecial ||
                     (SecondarySpecial != null && SecondarySpecial.Equals(input.SecondarySpecial))
                 ) &&
                 (
                     BackgroundColor == input.BackgroundColor ||
                     (BackgroundColor != null && BackgroundColor.Equals(input.BackgroundColor))
                 ) &&
                 (
                     Screenshot == input.Screenshot ||
                     (Screenshot != null && Screenshot.Equals(input.Screenshot))
                 ) &&
                 (
                     ItemTypeDisplayName == input.ItemTypeDisplayName ||
                     (ItemTypeDisplayName != null && ItemTypeDisplayName.Equals(input.ItemTypeDisplayName))
                 ) &&
                 (
                     FlavorText == input.FlavorText ||
                     (FlavorText != null && FlavorText.Equals(input.FlavorText))
                 ) &&
                 (
                     UiItemDisplayStyle == input.UiItemDisplayStyle ||
                     (UiItemDisplayStyle != null && UiItemDisplayStyle.Equals(input.UiItemDisplayStyle))
                 ) &&
                 (
                     ItemTypeAndTierDisplayName == input.ItemTypeAndTierDisplayName ||
                     (ItemTypeAndTierDisplayName != null && ItemTypeAndTierDisplayName.Equals(input.ItemTypeAndTierDisplayName))
                 ) &&
                 (
                     DisplaySource == input.DisplaySource ||
                     (DisplaySource != null && DisplaySource.Equals(input.DisplaySource))
                 ) &&
                 (
                     TooltipStyle == input.TooltipStyle ||
                     (TooltipStyle != null && TooltipStyle.Equals(input.TooltipStyle))
                 ) &&
                 (
                     Action == input.Action ||
                     (Action != null && Action.Equals(input.Action))
                 ) &&
                 (
                     Inventory == input.Inventory ||
                     (Inventory != null && Inventory.Equals(input.Inventory))
                 ) &&
                 (
                     SetData == input.SetData ||
                     (SetData != null && SetData.Equals(input.SetData))
                 ) &&
                 (
                     Stats == input.Stats ||
                     (Stats != null && Stats.Equals(input.Stats))
                 ) &&
                 (
                     EmblemObjectiveHash == input.EmblemObjectiveHash ||
                     (EmblemObjectiveHash.Equals(input.EmblemObjectiveHash))
                 ) &&
                 (
                     EquippingBlock == input.EquippingBlock ||
                     (EquippingBlock != null && EquippingBlock.Equals(input.EquippingBlock))
                 ) &&
                 (
                     TranslationBlock == input.TranslationBlock ||
                     (TranslationBlock != null && TranslationBlock.Equals(input.TranslationBlock))
                 ) &&
                 (
                     Preview == input.Preview ||
                     (Preview != null && Preview.Equals(input.Preview))
                 ) &&
                 (
                     Quality == input.Quality ||
                     (Quality != null && Quality.Equals(input.Quality))
                 ) &&
                 (
                     Value == input.Value ||
                     (Value != null && Value.Equals(input.Value))
                 ) &&
                 (
                     SourceData == input.SourceData ||
                     (SourceData != null && SourceData.Equals(input.SourceData))
                 ) &&
                 (
                     Objectives == input.Objectives ||
                     (Objectives != null && Objectives.Equals(input.Objectives))
                 ) &&
                 (
                     Metrics == input.Metrics ||
                     (Metrics != null && Metrics.Equals(input.Metrics))
                 ) &&
                 (
                     Plug == input.Plug ||
                     (Plug != null && Plug.Equals(input.Plug))
                 ) &&
                 (
                     Gearset == input.Gearset ||
                     (Gearset != null && Gearset.Equals(input.Gearset))
                 ) &&
                 (
                     Sack == input.Sack ||
                     (Sack != null && Sack.Equals(input.Sack))
                 ) &&
                 (
                     Sockets == input.Sockets ||
                     (Sockets != null && Sockets.Equals(input.Sockets))
                 ) &&
                 (
                     Summary == input.Summary ||
                     (Summary != null && Summary.Equals(input.Summary))
                 ) &&
                 (
                     TalentGrid == input.TalentGrid ||
                     (TalentGrid != null && TalentGrid.Equals(input.TalentGrid))
                 ) &&
                 (
                     InvestmentStats == input.InvestmentStats ||
                     (InvestmentStats != null && InvestmentStats.SequenceEqual(input.InvestmentStats))
                 ) &&
                 (
                     Perks == input.Perks ||
                     (Perks != null && Perks.SequenceEqual(input.Perks))
                 ) &&
                 (
                     LoreHash == input.LoreHash ||
                     (LoreHash.Equals(input.LoreHash))
                 ) &&
                 (
                     SummaryItemHash == input.SummaryItemHash ||
                     (SummaryItemHash.Equals(input.SummaryItemHash))
                 ) &&
                 (
                     Animations == input.Animations ||
                     (Animations != null && Animations.SequenceEqual(input.Animations))
                 ) &&
                 (
                     AllowActions == input.AllowActions ||
                     (AllowActions != null && AllowActions.Equals(input.AllowActions))
                 ) &&
                 (
                     Links == input.Links ||
                     (Links != null && Links.SequenceEqual(input.Links))
                 ) &&
                 (
                     DoesPostmasterPullHaveSideEffects == input.DoesPostmasterPullHaveSideEffects ||
                     (DoesPostmasterPullHaveSideEffects != null && DoesPostmasterPullHaveSideEffects.Equals(input.DoesPostmasterPullHaveSideEffects))
                 ) &&
                 (
                     NonTransferrable == input.NonTransferrable ||
                     (NonTransferrable != null && NonTransferrable.Equals(input.NonTransferrable))
                 ) &&
                 (
                     ItemCategoryHashes == input.ItemCategoryHashes ||
                     (ItemCategoryHashes != null && ItemCategoryHashes.SequenceEqual(input.ItemCategoryHashes))
                 ) &&
                 (
                     SpecialItemType == input.SpecialItemType ||
                     (SpecialItemType != null && SpecialItemType.Equals(input.SpecialItemType))
                 ) &&
                 (
                     ItemType == input.ItemType ||
                     (ItemType != null && ItemType.Equals(input.ItemType))
                 ) &&
                 (
                     ItemSubType == input.ItemSubType ||
                     (ItemSubType != null && ItemSubType.Equals(input.ItemSubType))
                 ) &&
                 (
                     ClassType == input.ClassType ||
                     (ClassType != null && ClassType.Equals(input.ClassType))
                 ) &&
                 (
                     BreakerType == input.BreakerType ||
                     (BreakerType != null && BreakerType.Equals(input.BreakerType))
                 ) &&
                 (
                     BreakerTypeHash == input.BreakerTypeHash ||
                     (BreakerTypeHash.Equals(input.BreakerTypeHash))
                 ) &&
                 (
                     Equippable == input.Equippable ||
                     (Equippable != null && Equippable.Equals(input.Equippable))
                 ) &&
                 (
                     DamageTypeHashes == input.DamageTypeHashes ||
                     (DamageTypeHashes != null && DamageTypeHashes.SequenceEqual(input.DamageTypeHashes))
                 ) &&
                 (
                     DamageTypes == input.DamageTypes ||
                     (DamageTypes != null && DamageTypes.SequenceEqual(input.DamageTypes))
                 ) &&
                 (
                     DefaultDamageType == input.DefaultDamageType ||
                     (DefaultDamageType != null && DefaultDamageType.Equals(input.DefaultDamageType))
                 ) &&
                 (
                     DefaultDamageTypeHash == input.DefaultDamageTypeHash ||
                     (DefaultDamageTypeHash.Equals(input.DefaultDamageTypeHash))
                 ) &&
                 (
                     SeasonHash == input.SeasonHash ||
                     (SeasonHash.Equals(input.SeasonHash))
                 ) &&
                 (
                     IsWrapper == input.IsWrapper ||
                     (IsWrapper != null && IsWrapper.Equals(input.IsWrapper))
                 ) &&
                 (
                     TraitIds == input.TraitIds ||
                     (TraitIds != null && TraitIds.SequenceEqual(input.TraitIds))
                 ) &&
                 (
                     TraitHashes == input.TraitHashes ||
                     (TraitHashes != null && TraitHashes.SequenceEqual(input.TraitHashes))
                 ) &&
                 (
                     Hash == input.Hash ||
                     (Hash.Equals(input.Hash))
                 ) &&
                 (
                     Index == input.Index ||
                     (Index.Equals(input.Index))
                 ) &&
                 (
                     Redacted == input.Redacted ||
                     (Redacted != null && Redacted.Equals(input.Redacted))
                 ));
        }