private void OnTriggerEnter2D(Collider2D collision)
 {
     if (FlagManager.GetFlag("bossFight") == "true" && BGMManager.instance.CurrBgmSource.clip != music)
     {
         BGMManager.instance.CrossFadeBgm(music, 2);
     }
 }
 private void InitMacros()
 {
     macroMap = new Dictionary <string, MacroFn>()
     {
         { "test", (args) => "test" },
         { "flag", (args) => FlagManager.GetFlag(args[1]) },
         { "color", ColorMacro },
         { "c", ColorMacro },
         { "img", ImgMacro },
         { "control", ControlMacro },
         { "goalItem", GoalItemMacro },
         { "goalFruitant", GoalFruitantMacro },
         { "devourer", DevourerMacro },
         { "weather", (args) => FlagManager.GetFlag("goal") == "desert" ? "snowfall" : "rainfall" },
         #region Character Name Shortcuts
         { "soma", (args) => ColorMacro("color", "soma", "Soma") },
         { "mana", (args) => ColorMacro("color", "mana", "Mana") },
         { "amrita", (args) => ColorMacro("color", "amrita", "Amrita") },
         { "nec", (args) => ColorMacro("color", "nec", "Nec") },
         { "nectar", (args) => ColorMacro("color", "nec", "Nectar") },
         #endregion
         #region Flavor Name Shortcuts
         { "spicy", (args) => ColorMacro("color", "spicy", "Spicy") + " " + ImgMacro("img", "IconSpicy") },
         { "sweet", (args) => ColorMacro("color", "sweet", "Sweet") + " " + ImgMacro("img", "IconSweet") },
         { "bitter", (args) => ColorMacro("color", "bitter", "Bitter") + " " + ImgMacro("img", "IconBitter") },
         { "sour", (args) => ColorMacro("color", "sour", "Sour") + " " + ImgMacro("img", "IconSour") },
         { "umami", (args) => ColorMacro("color", "umami", "Umami") + " " + ImgMacro("img", "IconUmami") },
         { "salty", (args) => ColorMacro("color", "salty", "Salty") + " " + ImgMacro("img", "IconSalty") },
         #endregion
     };
 }
Esempio n. 3
0
 // Update is called once per frame
 void Update()
 {
     if (FlagManager.GetFlag(key) == value)
     {
         Trigger();
     }
 }
 public string GoalFruitantMacro(params string[] args)
 {
     if (FlagManager.GetFlag("goal") == "desert")
     {
         return("Prickle Patriarch");
     }
     return("Paddle Patriarch");
 }
 public string GoalItemMacro(params string[] args)
 {
     if (FlagManager.GetFlag("goal") == "desert")
     {
         return("Golden Prickle Pear " + ImgMacro("img", "DropGoldenPricklepear"));
     }
     return("Golden Pear " + ImgMacro("img", "DropGoldenPear"));
 }
Esempio n. 6
0
 // Start is called before the first frame update
 void Start()
 {
     if (FlagManager.GetFlag("goal") == "desert")
     {
         desertMode.SetActive(true);
         marshMode.SetActive(false);
     }
 }
    private void Update()
    {
        //when the devourer is fed, shut down all teleporters and destroy all their drones
        if (FlagManager.GetFlag("party") == "true")
        {
            ShutOff();
            CharacterData cd;
            foreach (GameObject drone in droneArray)
            {
                cd = drone.GetComponent <CharacterData>();
                cd.DoDamage(999999);
            }
        }
        //create an overlap test box that only checks default
        if (active)
        {
            overlapped = CheckValidCollisions();

            if (overlapped)
            {
                //Debug.Log("OFF");
                sr.sprite   = offSprite;
                light.color = Color.red;
                blocked     = true;
                teleportRings.Stop();
            }
            else
            {
                //Debug.Log("ON");
                sr.sprite   = onSprite;
                light.color = Color.green;
                teleportRings.Play();
                blocked = false;
            }

            //check to see if all drones have been destroyed
            //if so, reset the timer

            for (int i = 0; i < droneArray.Length; i++)
            {
                if (droneArray[i] != null)
                {
                    timerReset = false;
                    break;
                }
                timerReset = true;
            }
            if (!recentlyReset && timerReset)
            {
                //Debug.Log("All drones dead - resetting timer");
                timerValue    = 10;
                recentlyReset = true;
            }
        }
    }
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (FlagManager.GetFlag(flag) == value)
     {
         Debug.Log("Triggering Event: " + name);
         var colliders = GetComponents <Collider2D>();
         foreach (var c in colliders)
         {
             c.enabled = false;
         }
         Trigger();
     }
 }
    protected override void OnTriggerEnter2D(Collider2D collision)
    {
        DestructableEnvironment envData = collision.GetComponent <DestructableEnvironment>();
        bool destroyed = true;

        if (envData != null)
        {
            destroyed = envData.destroyed;
        }
        base.OnTriggerEnter2D(collision);
        if (envData != null && !destroyed)
        {
            if (envData.destroyed)
            {
                string value = FlagManager.GetFlag("EnvDestroyedByFire");
                if (value == FlagManager.undefined || value == "0")
                {
                    return;
                }
                int numLeft = int.Parse(value);
                if (numLeft <= 1)
                {
                    FlagManager.SetFlag("EnvDestroyedByFire", "0");
                    if (QuestManager.instance.GetText().Contains("Burn"))
                    {
                        QuestManager.instance.SetText("Talk to {amrita}");
                    }
                }
                else
                {
                    FlagManager.SetFlag("EnvDestroyedByFire", (numLeft - 1).ToString());
                    if (QuestManager.instance.GetText().Contains("Burn"))
                    {
                        QuestManager.instance.SetText("{color,spicy,Burn} {flag,EnvDestroyedByFire} objects");
                    }
                }
            }
        }
    }
Esempio n. 10
0
        protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e)
        {
            if (e == null)
            {
                throw new ArgumentNullException("e");
            }

            // If ignoring the next mouse down, eat the mouse down
            var ignoreMouseDown = _flags.GetFlag(Flags.IgnoreNextMouseDown);

            _flags.SetFlag(Flags.IgnoreNextMouseDown, false);

            if (!e.Handled && IsMouseOver)
            {
                // If there is a popup open, see if the click was on a disabled menu item and if so, handle the mouse down
                if (!ignoreMouseDown && IsPopupOpen && !IsMouseDirectlyOver && e.Source is GameMenu)
                {
                    var presenter = e.OriginalSource as ContentPresenter;
                    if (presenter != null && VisualTreeHelper.GetChildrenCount(presenter) > 0)
                    {
                        var presenterContent = VisualTreeHelper.GetChild(presenter, 0) as UIElement;
                        if (presenterContent != null && !presenterContent.IsEnabled)
                        {
                            ignoreMouseDown = true;
                        }
                    }
                }

                if (ignoreMouseDown)
                {
                    e.Handled = true;
                    return;
                }
            }

            // Call the base method
            base.OnMouseLeftButtonDown(e);
        }
Esempio n. 11
0
    public void SelectAnswer(int index)
    {
        if (currentQuiz.correct == index)   // 정답
        {
            callDialogueViewer.cooldownTime = -1.0f;
            Debug.Log(
                $"[DEBUG] Execute : SelectAnswer() - Get Flag Color : {callDialogueViewer.transform.GetComponent<DefaultNPC>().ownFlag}"
                );
            flagManager.GetFlag(callDialogueViewer.transform.GetComponent <DefaultNPC>().ownFlag);
            RunCorrectAnimation();
        }
        else   // 오답
        {
            callDialogueViewer.cooldownTime = 30.0f;
        }

        uiBubble.ActiveBubble(false);

        callDialogueViewer.SetIndex($"s-{index + 1}");
        callDialogueViewer.PlayDialogue();

        ResetQuizManager();
    }
Esempio n. 12
0
        protected override void OnKeyDown(KeyEventArgs e)
        {
            base.OnKeyDown(e);

            if (ClickMode == ClickMode.Hover)
            {
                return;
            }

            if (e.Key == Key.Space)
            {
                if (((Keyboard.Modifiers & (ModifierKeys.Control | ModifierKeys.Alt)) != ModifierKeys.Alt) &&
                    !IsMouseCaptured &&
                    (e.OriginalSource == this))
                {
                    _flags.SetFlag(Flags.IsSpaceKeyDown, true);

                    IsPressed = true;
                    CaptureMouse();

                    if (ClickMode == ClickMode.Press)
                    {
                        RaiseClickEvent(new ExecuteRoutedEventArgs(ExecuteReason.Keyboard));
                    }

                    e.Handled = true;
                }
            }
            else if ((e.Key == Key.Return) && ((bool)GetValue(KeyboardNavigation.AcceptsReturnProperty)))
            {
                if (e.OriginalSource == this)
                {
                    _flags.SetFlag(Flags.IsSpaceKeyDown, false);

                    IsPressed = false;
                    if (IsMouseCaptured)
                    {
                        ReleaseMouseCapture();
                    }

                    RaiseClickEvent(new ExecuteRoutedEventArgs(ExecuteReason.Keyboard));

                    if ((IsKeyboardFocused) && !IsInMainFocusScope(this))
                    {
                        var popupAnchor = PopupControlService.GetParentPopupAnchor(this);
                        if ((popupAnchor == null) ||
                            (popupAnchor == this) ||
                            !popupAnchor.IsPopupOpen ||
                            !StaysOpenOnClick)
                        {
                            GameControl.BlurFocus(this, false);
                        }
                    }

                    e.Handled = true;
                }
            }
            else if (_flags.GetFlag(Flags.IsSpaceKeyDown))
            {
                IsPressed = false;

                _flags.SetFlag(Flags.IsSpaceKeyDown, false);

                if (IsMouseCaptured)
                {
                    ReleaseMouseCapture();
                }
            }
        }
 public string DevourerMacro(params string[] args)
 {
     return((FlagManager.GetFlag("goal") == "desert") ? "ChinCHILLa" : "RAINdeer");
 }