Example #1
0
        public void PassTurn()
        {
            if (gsi.passedLastTurn != StoneColor.none)
            {
                gsi.gameOver = true;
                //UpdateTerritoryCounts();//We shouldnt have to do this here since it was done after the last stone was played, and its passed?
                gsi.Tally();
                if (GameEndedEvent != null)
                {
                    GameEndedEvent.Raise();
                }
            }
            gsi.passedLastTurn = gsi.currentTurn;

            //AGA rules have you give your opponent a prisoner when you pass.
            //we store it as a separate int so we can implemenet different scoring system rulesets and compare.
            if (gsi.currentTurn == StoneColor.black)
            {
                gsi.timesBlackPassed++;
            }
            else if (gsi.currentTurn == StoneColor.white)
            {
                gsi.timesWhitePassed++;
            }

            gsi.currentTurn = OtherColor(gsi.currentTurn);
            if (TurnResponseEvent != null)
            {
                TurnResponseEvent.Raise(true);
            }
            if (TurnResponseCodeEvent != null)
            {
                TurnResponseCodeEvent.Raise(1);
            }
        }
    private void addAlienTypeToSpawner(alienType type)
    {
        int typeInt = 0;

        switch (type)
        {
        case alienType.Circle:
            typeInt = 0;
            break;

        case alienType.CrushedSquare:
            typeInt = 1;
            break;

        case alienType.CirclePair:
            typeInt = 2;
            break;

        case alienType.CircleTrio:
            typeInt = 3;
            break;

        case alienType.LongSquare:
            typeInt = 4;
            break;
        }
        addAlienTypeEvent.Raise(typeInt);
    }
Example #3
0
        private void OnLoadSceneEvent(object[] data)
        {
            int sceneIndex = (int)data[0];

            loadSceneEvent.Raise(sceneIndex);
            Debug.Log("PUN Event: scene change to: " + sceneIndex);
        }
    private void changeBreathDifficulty(difficulty diff)
    {
        // 0 = Slowest/Deepest, 1 = Slow/Deep, 2 = Medium, 3 = Fast/Shallow
        int diffInt;

        switch (diff)
        {
        case difficulty.Deepest:
            diffInt = 0;
            break;

        case difficulty.Deep:
            diffInt = 1;
            break;

        case difficulty.Normal:
            diffInt = 2;
            break;

        case difficulty.Quick:
            diffInt = 3;
            break;

        default:
            diffInt = 2;
            break;
        }
        changeDifficultyEvent.Raise(diffInt);
    }
 private void Update()
 {
     if (Input.GetKeyDown(KeyCode.Alpha1))
     {
         on1Pressed.Raise();
         onIntSupplied.Raise(42);
     }
 }
Example #6
0
 private void CustomerSatisfied()
 {
     PlayRandomSound(customerProfile.customerSatisfiedSounds);       //audio
     customerSatisfiedEvent.Raise(customerOrder.Ingredients.Length); //tally and adjust score
     orderPromptController.OnSuccessfulOrder();                      //update visuals
     orderHasBeenDelivered = true;                                   //flag to reject all future Orders
     //Debug.Log("Thanks for the Pizza!!!!");
 }
Example #7
0
 void OnTriggerEnter(Collider other)
 {
     if (other.CompareTag("Player"))
     {
         CashEvent.Raise(CashAmount);
         Destroy(gameObject);
     }
 }
Example #8
0
        private void HandleVariable(EventData <int> data)
        {
            if (internalUpdate)
            {
                return;
            }

            internalUpdate = true;

            hostDropdown.value = data.value;

            if (onValueChangedEvent != null)
            {
                onValueChangedEvent.Raise(valueVariable, data.value);
            }

            internalUpdate = false;
        }
Example #9
0
    void HandleClick()
    {
        if (skill == null)
        {
            //ShowAvailableSkillsPanel();
        }

        if (skill != null)
        {
            OnSkillPressed.Raise(index);
        }
    }
Example #10
0
 private void onButtonPress(SelectableActionType actionType)
 {
     onActionSelectedEvent.Raise((int)actionType);
     if (actionType == SelectableActionType.Build)
     {
         this.loadBuildOptions();
     }
     if (actionType == SelectableActionType.ChangeGrid)
     {
         ((Planet)this.parentSelectable).TryPerformAction(actionType, null, "");
     }
 }
Example #11
0
    public override void OnInspectorGUI()
    {
        //base.OnInspectorGUI();
        EditorGUILayout.HelpBox("This Game-Event passes along a single integer value", MessageType.Info, true);
        IntGameEvent e = (IntGameEvent)target;

        GUI.enabled  = Application.isPlaying;
        e.debugValue = EditorGUILayout.IntField("Debug Value", e.debugValue);
        if (GUILayout.Button("Raise Event"))
        {
            e.Raise(e.debugValue);
            e.DebugMessage();
        }
    }
Example #12
0
    IEnumerator showOrder()
    {
        showSequenceEvent.Raise(false);

        yield return(new WaitForSeconds(1f));

        foreach (int n in buttonOrder)
        {
            glowButton.Raise(n);
            yield return(new WaitForSeconds(1f));
        }
        expectedButtonIndex = 0;

        showSequenceEvent.Raise(true);
    }
Example #13
0
 // Implement IUnityAdsListener interface methods:
 public void OnUnityAdsDidFinish(string placementId, ShowResult showResult)
 {
     // Define conditional logic for each ad completion status:
     if (showResult == ShowResult.Finished)
     {
         // Reward the user for watching the ad to completion.
         Debug.Log("Finished Rewarded Add");
         AddCashEvent.Raise(RewardAmount);
     }
     else if (showResult == ShowResult.Skipped)
     {
         // Do not reward the user for skipping the ad.
         Debug.Log("Skipped Rewarded Add");
     }
     else if (showResult == ShowResult.Failed)
     {
         Debug.LogWarning("The ad did not finish due to an error.");
     }
 }
        // Draw the property inside the given rect
        public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
        {
            // Using BeginProperty / EndProperty on the parent property means that
            // prefab override logic works on the entire property.
            EditorGUI.BeginProperty(position, label, property);

            var indent = EditorGUI.indentLevel;

            EditorGUI.indentLevel = 0;

            Rect buttonPosition  = new Rect(position.x, position.y + 5, position.width, 30);
            Rect idInputPosition = new Rect(position.x, buttonPosition.y + 35, position.width, 25);

            this.instanceId = EditorGUI.IntField(idInputPosition, this.instanceId);

            bool clicked = GUI.Button(buttonPosition, "Raise Event");

            if (clicked)
            {
                IntGameEvent gameEvent = property.objectReferenceValue as IntGameEvent;
                gameEvent?.Raise(this.instanceId);
                if (gameEvent != null)
                {
                    Debug.Log("Successfully raised event");
                }
            }

            var newPos = new Rect(idInputPosition.x, idInputPosition.y + 35, position.width, 25);

            EditorGUI.PropertyField(newPos, property, GUIContent.none);

            // Set indent back to what it was
            EditorGUI.indentLevel = indent;

            EditorGUI.EndProperty();
        }
Example #15
0
        //The event to open and close // to be used if there is a toggle.
        //[Serializable] IntGameEvent CloseWindowEvent;

        //Callback function.
        public void OpenWindow()
        {
            //Raise the open window event at the value of hte handle window.
            OpenWindowEvent.Raise(WindowHandle.Value);
        }
 public void OnInventoryItemHovered()
 {
     onHoverEvent.Raise(ID);
 }
 public void OnInventoryItemClicked()
 {
     onClickEvent.Raise(ID);
 }
Example #18
0
 private void RaiseUpdateJumpcountEvent()
 {
     UpdateJumpCountEvent.Raise(jumpCount.Data);
 }
Example #19
0
        private void SelectFile()
        {
            selectFileEvent.Raise(indexReference);

            Debug.Log("FILE SELECTED! AT: " + IndexReference);
        }
Example #20
0
 private void SetSceneInfo()
 {
     startingPositionVariable.Value = startingPosition;
     loadSceneEvent.Raise(sceneIndex);
 }
    // HERE JAMES
    private IEnumerator NarrativeSteps()
    {
        playInterComSound = true;
        displayStepText();
        switch (currentIndex)
        {
        case 0:
            textDisplayDuration = 7;
            timeBetweenSteps    = 0;
            noHideRaise         = true;
            noDisplayRaise      = true;
            break;
        //Hello Cadet! Welcome aboard the SS Junk! I’m Captain Von Droop!”

        case 1:
            textDisplayDuration = 13;
            timeBetweenSteps    = 0;
            noHideRaise         = true;
            noDisplayRaise      = true;
            break;
        //We travel deep into space to process aliens like Blumps and Grunks. They’re valuale and pretty cute! The deeper we go, the more we’ll find!

        case 2:
            textDisplayDuration = 9;
            timeBetweenSteps    = 0;
            noHideRaise         = true;
            noDisplayRaise      = true;
            break;

        //Your job is to receive Blumps and Grumps from the chute, process them and sort them into these bins.
        case 3:
            textDisplayDuration = 6;
            timeBetweenSteps    = 0;
            noHideRaise         = true;
            noDisplayRaise      = true;
            break;

        //Air circulation is very important on this ship. You remember how to breathe right?
        case 4:
            textDisplayDuration = 9;
            timeBetweenSteps    = 0;
            noHideRaise         = true;
            noDisplayRaise      = true;
            break;

        //Watch the breath gauge! Use LEFT CTRL and RIGHT CTRL to inhale and exhale while in the Yellow zones
        //Breathe NORMAL
        case 5:
            textDisplayDuration = 6;
            timeBetweenSteps    = 0;
            noHideRaise         = true;
            noDisplayRaise      = true;
            startInhaleEvent.Raise();
            break;
        //Remember if you fail to breathe properly you will pass out - be careful!

        case 6:
            textDisplayDuration = 10;
            timeBetweenSteps    = 20;

            CameraShakeEvent.Raise(0);
            EmergencySirenEvent.Raise(true);

            playSFX(sfx.Siren);

            spawnAlien(alienType.Circle, 2);
            spawnAlien(alienType.CrushedSquare, 2);
            setAlienLimitEvent.Raise(10);
            setSpawnMultiplierEvent.Raise(1f);
            noHideRaise    = false;
            noDisplayRaise = false;
            break;

        //Fresh Aliens incoming! Put the Purple Blumbles in the Purple Bin and the Orange Grunks in the orange bin.
        //Spawn 3 Blumbles & 3 Grunks
        //Variable spawn rate of BlumbleB's and GrunksB's
        case 7:
            textDisplayDuration = 6;
            timeBetweenSteps    = 15;
            EmergencySirenEvent.Raise(false);
            CameraShakeEvent.Raise(3);
            stopSFX(sfx.Siren);

            addAlienTypeToSpawner(alienType.CirclePair);
            addAlienTypeToSpawner(alienType.CircleTrio);
            spawnAlien(alienType.CirclePair, 1);
            spawnAlien(alienType.CircleTrio, 1);
            noHideRaise    = false;
            noDisplayRaise = false;
            break;

        //Whoa those Blumbles need to be cut! Use the laser!
        //Summon BlumbleA's
        case 8:
            playSFX(sfx.Oxygen);
            textDisplayDuration = 6;
            timeBetweenSteps    = 15;
            EmergencySirenEvent.Raise(true);
            CameraShakeEvent.Raise(1);
            changeBreathDifficulty(difficulty.Deep);
            noHideRaise    = false;
            noDisplayRaise = false;
            break;

        //Uhh sorry cadet! Our new intern broke our oxygen valve, breathe deeper while I fix this!
        //Breathe DEEP
        case 9:
            stopSFX(sfx.Oxygen);
            textDisplayDuration = 6;
            timeBetweenSteps    = 0;
            EmergencySirenEvent.Raise(false);
            changeBreathDifficulty(difficulty.Normal);
            noHideRaise    = true;
            noDisplayRaise = true;
            break;

        //FIXED! You can breathe normally now - Ugh Interns are the worst sometimes.
        //Breath NORMAL
        case 10:
            textDisplayDuration = 6;
            timeBetweenSteps    = 10;
            EmergencySirenEvent.Raise(true);
            playSFX(sfx.Siren);
            CameraShakeEvent.Raise(4);
            playSFX(sfx.HyperSpace);
            setAlienLimitEvent.Raise(20);
            setSpawnMultiplierEvent.Raise(1.5f);
            stopSFX(sfx.Siren);
            noHideRaise    = false;
            noDisplayRaise = false;
            break;

        //Alright let’s go DEEPER INTO SPACE! Watch out for more aliens!
        //Increase spawn rate after transition
        case 11:
            textDisplayDuration = 6;
            timeBetweenSteps    = 15;
            EmergencySirenEvent.Raise(false);
            addAlienTypeToSpawner(alienType.LongSquare);
            spawnAlien(alienType.LongSquare, 3);
            noHideRaise    = false;
            noDisplayRaise = false;
            break;

        //Ah! Those grunks are too big! Use the crusher!
        //Spawn GrunkA's
        case 12:
            textDisplayDuration = 10;
            timeBetweenSteps    = 20;
            changeBreathDifficulty(difficulty.Quick);
            playSFX(sfx.Siren);
            playSFX(sfx.PirateBattle);
            CameraShakeEvent.Raise(1);
            FlickerOff.Raise();
            EmergencySirenEvent.Raise(true);
            noHideRaise    = false;
            noDisplayRaise = false;
            break;

        //Oh no Pirates are attacking - everyone panic and breathe quickly! Intern help me EEK!
        //Breath QUICKLY
        case 13:
            textDisplayDuration = 9;
            timeBetweenSteps    = 10;
            changeBreathDifficulty(difficulty.Normal);
            stopSFX(sfx.Siren);
            FlickerOn.Raise();
            EmergencySirenEvent.Raise(false);
            CameraShakeEvent.Raise(4);
            playSFX(sfx.HyperSpace);
            setAlienLimitEvent.Raise(30);
            setSpawnMultiplierEvent.Raise(2f);
            stopSFX(sfx.PirateBattle);
            noHideRaise    = false;
            noDisplayRaise = false;
            break;

        //Let's get out of here! Onwards to Deepest Space! Breath normally but Expect a lot of aliens...
        //Breath NORMAL
        case 14:
            textDisplayDuration = 7;
            timeBetweenSteps    = 20;
            changeBreathDifficulty(difficulty.Deep);
            noHideRaise    = false;
            noDisplayRaise = false;
            break;

        //Is that…a lavender scented candle? Nice! Everyone - Breath that in deeply!
        //Breath DEEPLY
        case 15:
            textDisplayDuration = 7;
            timeBetweenSteps    = 20;
            changeBreathDifficulty(difficulty.Deepest);
            CameraShakeEvent.Raise(3);
            noHideRaise    = false;
            noDisplayRaise = false;
            break;

        //Whoa slow down - that’s not lavender - that’s eucalyptus - my favorite!! Breath as deep as you can!
        //Breath DEEPEST
        case 16:
            textDisplayDuration = 7;
            timeBetweenSteps    = 15;
            changeBreathDifficulty(difficulty.Normal);
            noHideRaise    = false;
            noDisplayRaise = false;
            break;

        //Ahh that was nice... Alright - Breath normally
        //Breath NORMAL
        case 17:
            textDisplayDuration = 7;
            timeBetweenSteps    = 2;
            narrativeComplete   = true;
            setSpawnMultiplierEvent.Raise(0f);
            noHideRaise    = false;
            noDisplayRaise = false;
            break;
            //Great work cadet! We ventured to deepest space and cleansed the galaxy! Great job!
        }
        if (playInterComSound)
        {
            playSFX(sfx.Intercom);
        }
        yield return(null);
    }
 public void b_IncrementScore()
 {
     score++;
     scoreEvent.Raise(score);
 }
Example #23
0
 public override void Execute(Entity e)
 {
     _gainPointsEvent.Raise(_pointsToGain);
 }