Пример #1
0
        protected override void OnTileChanged()
        {
            base.OnTileChanged();

            var zone = Zone;

            if (zone == null)
            {
                return;
            }

            MissionHandler?.MissionUpdateOnTileChange();

            var controlInfo = zone.Terrain.Controls.GetValue(CurrentPosition);

            ApplyHighwayEffect(controlInfo.IsAnyHighway);

            if (zone.Configuration.Protected)
            {
                return;
            }

            //PVP zone
            ApplySyndicateAreaEffect(controlInfo.SyndicateArea);
        }
Пример #2
0
 public void AddMission(MissionTypes type, int target, int start)
 {
     mission = new MissionHandler(this);
     mission.enemiesToKill = target;
     mission.enemiesKilled = start;
     OnMissionAdd.Invoke(mission);
 }
Пример #3
0
        protected override void OnLockStateChanged(Lock @lock)
        {
            base.OnLockStateChanged(@lock);

            if (@lock is UnitLock u)
            {
                var player = u.Target as Player;
                player?.Session.CancelLogout();

                if (@lock.State == LockState.Locked)
                {
                    //  !!
                    //  this will enqueue primary, secondary, and will also fire if a primary is converted to secondary
                    //  !!

                    var npc = u.Target as Npc;

                    if (npc != null)
                    {
                        MissionHandler.EnqueueMissionEventInfo(new LockUnitEventInfo(this, npc, npc.CurrentPosition));
                        MissionHandler.SignalParticipationByLocking(npc.GetMissionGuid());
                    }
                }
            }

            if (@lock.State == LockState.Inprogress && EffectHandler.ContainsEffect(EffectType.effect_invulnerable))
            {
                EffectHandler.RemoveEffectsByType(EffectType.effect_invulnerable);
            }
        }
Пример #4
0
    private void OptionsParser(DialogueBase db)
    {
        if (db is DialogueOptions)
        {
            isDialogueOption = true;
            DialogueOptions dialgoueOption = db as DialogueOptions;
            numOfOptions      = dialgoueOption.optionsInfo.Length;
            questionText.text = dialgoueOption.questionText;

//            optionButtons[0].GetComponent<Button>().Select(); //select option with keyboard

            for (int i = 0; i < numOfOptions; i++)
            {
                optionButtons[i].SetActive(true);
                optionButtons[i].transform.GetChild(0).GetComponent <TextMeshProUGUI>().text =
                    dialgoueOption.optionsInfo[i].buttonName;
                MissionHandler handleEvent = optionButtons[i].GetComponent <MissionHandler>();
                handleEvent.EventHandler = dialgoueOption.optionsInfo[i].missionEvent;
            }
        }
        else
        {
            isDialogueOption = false;
        }
    }
Пример #5
0
    // Start is called before the first frame update
    void Start()
    {
        displayText        = GameObject.Find("DisplayText");
        dockedMessage      = GameObject.Find("Docked").GetComponent <TextMeshPro>();
        fuelCounter        = GameObject.Find("FuelCounter").GetComponent <TextMeshPro>();
        velCounter         = GameObject.Find("Velocity").GetComponent <TextMeshPro>();
        angVelCounter      = GameObject.Find("AngularVelocity").GetComponent <TextMeshPro>();
        missionAlert       = GameObject.Find("MissionAlert").GetComponent <TextMeshPro>();
        pickupMessage      = GameObject.Find("PickUpMessage").GetComponent <TextMeshPro>();
        dropoffMessage     = GameObject.Find("DropOffMessage").GetComponent <TextMeshPro>();
        timer              = GameObject.Find("Timer").GetComponent <TextMeshPro>();
        creditsCounter     = GameObject.Find("Credits").GetComponent <TextMeshPro>();
        bestCreditsCounter = GameObject.Find("BestCredits").GetComponent <TextMeshPro>();
        commsMessage       = GameObject.Find("CommsMessage").GetComponent <TextMeshPro>();

        baseTextColor = pickupMessage.color;

        fuelWarning    = GameObject.Find("FuelWarning").GetComponent <AudioSource>();
        ambience       = GameObject.Find("Ambience").GetComponent <AudioSource>();
        powerDown      = GameObject.Find("PowerDown").GetComponent <AudioSource>();
        thruster       = GameObject.Find("Thrusters").GetComponent <AudioSource>();
        cameraScreen   = GameObject.Find("CameraScreen").GetComponent <MeshRenderer>();
        missionHandler = GameObject.Find("GameManager").GetComponent <MissionHandler>();

        rb       = GetComponent <Rigidbody>();
        keyboard = Keyboard.current;
    }
Пример #6
0
        public void SetMissionHandler(MissionHandler handler)
        {
            DebugLog.Finer($"MUI_Model: Setting mission handler: {handler.type} expecting {handler.enemiesToKill} kills with current kills {handler.enemiesKilled}");

            _missionHandler = handler;
            OnMissionChangedEvent.Invoke(_missionHandler);
        }
        // MissionHandlerManager sequence
        // Add => Check => Assign => Update => Check => Complete => Check => Assign...

        public void AddMission(MissionHandler handler, bool check = true)
        {
            DebugLog.Fine(this, $"{_prefix} Adding new mission: {MH_ToString(handler)}");

            _missionHandlers.Enqueue(handler);

            CheckMission(check);
        }
Пример #8
0
    // Start is called before the first frame update
    void Start()
    {
        inProgress = true;

        handler = GetComponentInParent <MissionHandler>();
        handler.OpenTextBox(NPCIntro);

        questHeader      = handler.questHeader;
        questHeader.text = simpText;
    }
Пример #9
0
        protected override void OnUpdate(TimeSpan time)
        {
            base.OnUpdate(time);
            UpdateCombat(time);
            _movement.Update(time);
            _blobHandler.Update(time);
            MissionHandler.Update(time);

            _combatLogger?.Update(time);
        }
 private string MH_ToString(MissionHandler handler)
 {
     if (handler != null)
     {
         return($"{{{handler.type}, progress {handler.enemiesKilled}, expecting {handler.enemiesToKill}, has done {handler.IsDone}}}");
     }
     else
     {
         return($"{{null}}");
     }
 }
 void Awake()
 {
     if (mission == null)
     {
         DontDestroyOnLoad(gameObject);
         mission = this;
     }
     else if (mission != this)
     {
         Destroy(gameObject);
     }
 }
        public void SetMission(MissionHandler handler)
        {
            DebugLog.Finer(this, $"MUI_View: Getting/Assigning mission information: {handler.type} expecting {handler.enemiesToKill} kills with current kills {handler.enemiesKilled}");

            _descriptionTextFormat = GetMissionDescriptionString(handler.type);
            _progressTextFormat    = GetMissionProgressString(handler.type);

            SetMaxProgress(handler.enemiesToKill);
            SetProgress(handler.enemiesKilled);

            ToggleUIPanel(true);
        }
        public void AssignMission()
        {
            if (_missionHandlers.Count != 0)
            {
                if (_currentMission != null)
                {
                    DebugLog.Warning(this, $"{_prefix} Overwriting mission!: {MH_ToString(_currentMission)}");
                }

                _currentMission = _missionHandlers.Dequeue();
                DebugLog.Fine(this, $"{_prefix} Assigned mission: {MH_ToString(_currentMission)}");

                OnMissionAssignEvent.Invoke(GetCurrentMission());
            }
        }
        public void CompleteMission(bool check = true)
        {
            DebugLog.Fine(this, $"{_prefix} Completing mission: {MH_ToString(_currentMission)}");

            if (_currentMission == null)
            {
                DebugLog.Severe(this, $"{_prefix} Cannot complete mission because current mission is null!!");
                return;
            }

            OnMissionCompleteEvent.Invoke(_currentMission);
            _currentMission = null;

            CheckMission(check);
        }
    void Start()
    {
        // Watch for when a new mission is assigned, to prepare to reward or
        // penalize the player
        missionHandler = MissionHandler.S;
        missionHandler.NewMissionAssigned.AddListener(OnNewMissionAssigned);

        gameController = GameController.S;
        gameController.PlayerWon.AddListener(Pause);

        // Make it so the score is only updated when it needs to be
        player.statusEvents.ScoreLowered.AddListener(UpdateDisplay);
        player.statusEvents.ScoreRaised.AddListener(UpdateDisplay);
        player.statusEvents.ScoreRaised.AddListener(CheckIfWin);
        UpdateDisplay();
    }
Пример #16
0
    private void Awake()
    {
        #region // Singleton stuff
        // We should only have one instance of the handler
        if (missionHandler != null)
        {
            Destroy(gameObject);

            return;
        }

        // This is the singleton
        missionHandler = this;

        cleanUp = true;

        #endregion

        #region // Set up canvas
        // The canvas used to display mission information

        // Disable canvas until it's time to show the missions
        //missionCanvas.SetActive(true);
        #endregion



        // Inactivate all missions at start

        //TurnOffAll();

        RemoveAccomplished();



        MissionsGameObjects = missionUI.transform.Find("Missions").gameObject;


        //RandomizeMissions();
        //ShowMissions();
        //HideMissions();
    }
Пример #17
0
        protected override void OnEnterZone(IZone zone, ZoneEnterType enterType)
        {
            base.OnEnterZone(zone, enterType); //aa

            zone.SendPacketToGang(Gang, new GangUpdatePacketBuilder(Visibility.Visible, this));

            MissionHandler = _missionHandlerFactory(zone, this);
            MissionHandler.InitMissions();

            Direction = FastRandom.NextDouble();

            var p = DynamicProperties.GetProperty <int>(k.pvpRemaining);

            if (!p.HasValue)
            {
                return;
            }

            ApplyPvPEffect(TimeSpan.FromMilliseconds(p.Value));
            p.Clear();
        }
 private void MissionUpdate(MissionHandler handler)
 {
     currentView.UpdateMessage(handler.enemiesKilled, handler.enemiesToKill);
 }
 private void MissionAssign(MissionHandler handler)
 {
     currentView.Assign(GetMissionDescriptionString(handler.type), GetMissionProgressString(handler.type), handler.enemiesKilled, handler.enemiesToKill);
 }
Пример #20
0
 public void SetMissionDatabase(MissionHandler handler)
 {
     CutsceneDataContainer.missionHandler = handler;
 }
 private void MissionComplete(MissionHandler handler)
 {
     currentView.Complete(handler.enemiesKilled, handler.enemiesToKill);
     ChangePanel();
 }
Пример #22
0
 private void Awake()
 {
     handler = FindObjectOfType <MissionHandler>();
 }
Пример #23
0
 public CutsceneDataContianer()
 {
     cutsceneDatabase = new SavedDatabase <CutScene>();
     missionHandler   = new MissionHandler();
     barDatabase      = new SavedDatabase <Bar>();
 }
Пример #24
0
 public Mission(GameObject subject)
 {
     missionHandler = Object.FindObjectOfType <MissionHandler>();
     this.subject   = subject;
 }
Пример #25
0
 public Mission()
 {
     missionHandler = Object.FindObjectOfType <MissionHandler>();
 }