예제 #1
0
    public void PlayScheduleAlarm(Schedule schedule, ScheduleBlock block, bool forwards)
    {
        Notification notification = new Notification(string.Format(MISC.NOTIFICATIONS.SCHEDULE_CHANGED.NAME, schedule.name, block.name), NotificationType.Good, HashedString.Invalid, (List <Notification> notificationList, object data) => string.Format(MISC.NOTIFICATIONS.SCHEDULE_CHANGED.TOOLTIP, schedule.name, block.name, Db.Get().ScheduleGroups.Get(block.GroupId).notificationTooltip), null, true, 0f, null, null, null);

        GetComponent <Notifier>().Add(notification, string.Empty);
        StartCoroutine(PlayScheduleTone(schedule, forwards));
    }
        public ScheduleBlock ExecuteItem(DataContext dataContext)
        {
            ScheduleBlock scheduleBlock = dataContext.ScheduleBlockSet.Where(x => x.Id == this.Id).SingleOrDefault();

            if (scheduleBlock != null)
            {
                return(scheduleBlock);
            }

            ScheduleRule scheduleRule = new GetScheduleRule()
            {
                Id = this.RuleId, ProviderId = this.ProviderId
            }.ExecuteItem(dataContext);

            if (scheduleRule == null)
            {
                return(null);
            }

            return(new ScheduleBlock()
            {
                Id = this.Id,
                EmployeeId = scheduleRule.EmployeeId,
                Start = this.Start,
                End = new DateTime(this.Start.Year, this.Start.Month, this.Start.Day, scheduleRule.EndHour.Value, scheduleRule.EndMinute.Value, 0),
            });
        }
        public async Task <IActionResult> PostScheduleBlock([FromBody] ScheduleBlock scheduleBlock)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            var user = await this.UserManager.GetUserAsync(this.User);

            var tutor = _context.Tutors.Where(t => t.Email == user.Email).FirstOrDefault();

            if (tutor == null)
            {
                return(BadRequest("non-tutor users arent allowed to create schedule blocks."));
            }

            scheduleBlock.StartTime = scheduleBlock.StartTime.ToUniversalTime();
            scheduleBlock.EndTime   = scheduleBlock.EndTime.ToUniversalTime();

            scheduleBlock.Tutor = tutor;

            _context.ScheduleBlocks.Add(scheduleBlock);
            await _context.SaveChangesAsync();

            //null the tutor out for the return...
            scheduleBlock.Tutor = null;

            return(CreatedAtAction("GetScheduleBlock", new { id = scheduleBlock.Id }, scheduleBlock));
        }
        public async Task <IActionResult> PutScheduleBlock([FromRoute] Guid id, [FromBody] ScheduleBlock scheduleBlock)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != scheduleBlock.Id)
            {
                return(BadRequest());
            }

            _context.Entry(scheduleBlock).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!ScheduleBlockExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
예제 #5
0
        public void UpsertScheduleBlock(ScheduleBlock scheduleBlock)
        {
            // Step 1. Find existing
            ScheduleBlock item   = GetScheduleBlock(scheduleBlock.Start, scheduleBlock.ScheduleRule.EmployeeId);
            bool          exists = item != null;

            if (!exists)
            {
                item = new ScheduleBlock()
                {
                    Id = scheduleBlock.Id, ProviderId = this.ProviderId
                };
                this.ScheduleRuleList.Find(x => x.Id == scheduleBlock.ScheduleRuleId).ScheduleBlockCollection.Add(item);
            }

            // Step 2.
            this.Map(scheduleBlock, item);

            // Step 3.
            using (DataContext dataContext = DataContext.Create())
            {
                //if (scheduleBlock.Saved == null)
                //{
                //    dataContext.ScheduleBlockSet.Add(item);
                //}
                //else
                //{
                //    var existingItem = dataContext.ScheduleBlockSet.Where(x => x.Start == scheduleBlock.Start && x.ScheduleRule.EmployeeId == scheduleBlock.ScheduleRule.EmployeeId);
                //    this.Map(scheduleBlock, item);
                //}
            }
        }
예제 #6
0
        public static ScheduleGroup GetScheduleGroup(this ScheduleBlock block)
        {
            ScheduleGroup group;
            var           scheduleGroups = Db.Get().ScheduleGroups;

            switch (block.GroupId)
            {
            case nameof(scheduleGroups.Hygene):
                @group = scheduleGroups.Hygene;
                break;

            case nameof(scheduleGroups.Worktime):
                @group = scheduleGroups.Worktime;
                break;

            case nameof(scheduleGroups.Recreation):
                @group = scheduleGroups.Recreation;
                break;

            case nameof(scheduleGroups.Sleep):
                @group = scheduleGroups.Sleep;
                break;

            default:
                @group = scheduleGroups.Worktime;
                break;
            }

            return(new ScheduleGroup(group.Id, scheduleGroups, 1, group.Name, group.description,
                                     group.notificationTooltip, group.allowedTypes, group.alarm));
        }
예제 #7
0
        public void Sim200ms(float dt)
        {
            try
            {
                Schedule s = ScheduleManager.Instance.GetSchedules()[scheduleIndex];
                int      currentScheduleBlock = Schedule.GetBlockIdx();

                float meterPercent = (float)(currentScheduleBlock) / 24f;
                meter.SetPositionPercent(meterPercent);

                ScheduleBlock b = s.GetBlock(currentScheduleBlock);
                string        currentScheduleGroup = b.GroupId;

                meter.SetSymbolTint("face", GetBlockColor(b));

                string selectedScheduleGroup = Db.Get().ScheduleGroups.allGroups[blockTypeIndex].Id;

                bool state = (string.Equals(currentScheduleGroup, selectedScheduleGroup));
                SetState(state);
            }
            catch (Exception ex)
            {
                Debug.Log($"Failed to update Schedule Sensor: {ex.ToString()}");
                SetState(false);
            }
        }
예제 #8
0
    public bool IsAllowed(Schedulable schedulable, ScheduleBlockType schedule_block_type)
    {
        int           blockIdx = Schedule.GetBlockIdx();
        ScheduleBlock block    = GetSchedule(schedulable).GetBlock(blockIdx);

        return(block.IsAllowed(schedule_block_type));
    }
예제 #9
0
        public int AddScheduleBlock(ScheduleBlock scheduleBlock)
        {
            this.DataContext.ScheduleBlockSet.Add(scheduleBlock);
            int result = this.DataContext.SaveChanges();

            this.ScheduleBlockList.Add(scheduleBlock);
            return(result);
        }
 public void Refresh()
 {
     if ((Object)schedulable != (Object)null)
     {
         int blockIdx = Schedule.GetBlockIdx();
         scheduleBlock = schedulable.GetSchedule().GetBlock(blockIdx);
     }
 }
예제 #11
0
 public void SetGroup(int idx, ScheduleGroup group)
 {
     if (0 <= idx && idx < blocks.Count)
     {
         blocks[idx] = new ScheduleBlock(group.Name, group.allowedTypes, group.Id);
         Changed();
     }
 }
예제 #12
0
 private void Map(ScheduleBlock source, ScheduleBlock target)
 {
     target.End            = source.End;
     target.IsAllDay       = source.IsAllDay;
     target.ScheduleRuleId = source.ScheduleRuleId;
     target.Start          = source.Start;
     target.Saved          = source.Saved ?? DateTime.UtcNow;
 }
예제 #13
0
        private ScheduleBlock SeparateSection(ScheduleBlock block, ISplitRule splitRule)
        {
            var segments = new List <ScheduleSegment>();

            foreach (var segment in block.ScheduleSegments)
            {
                segments.AddRange(splitRule.Split(segment));
            }

            block.ScheduleSegments = segments;
            return(block);
        }
예제 #14
0
        private Color GetBlockColor(ScheduleBlock b)
        {
            if (ScheduleScreen_OnPrefabInit_Patch.blockColors == null)
            {
                return(Color.white);
            }
            if (ScheduleScreen_OnPrefabInit_Patch.blockColors.TryGetValue(b.GroupId, out ColorStyleSetting col))
            {
                return(col.activeColor);
            }

            return(Color.white);
        }
예제 #15
0
        private ScheduleBlock Order(ScheduleBlock block)
        {
            // sort segments
            block.ScheduleSegments = block
                                     .ScheduleSegments
                                     .OrderBy(s => s.SortPriority);

            // sort items
            foreach (var segment in block.ScheduleSegments)
            {
                segment.ScheduleItems = segment
                                        .ScheduleItems
                                        .OrderBy(sch => sch.BunchPriority)
                                        .ThenBy(sch => sch.TimePriority);
            }

            return(block);
        }
 private static ScheduleBlock[] DeserializeScheduleBlocks(Dictionary <string, object> dict)
 {
     string[] array = TFUtils.LoadString(dict, "ScheduleTime").Split(new char[]
     {
         '_'
     });
     string[] array2 = TFUtils.LoadString(dict, "ScheduleDestination").Split(new char[]
     {
         '_'
     });
     string[] array3 = TFUtils.LoadString(dict, "ScheduleAction").Split(new char[]
     {
         '_'
     });
     ScheduleBlock[] array4 = new ScheduleBlock[array.Length];
     for (int i = 0; i < array4.Length; i++)
     {
         array4[i] = new ScheduleBlock(float.Parse(array[i]), array2[i], array3[i]);
     }
     return(array4);
 }
    public ChoreConsumerState(ChoreConsumer consumer)
    {
        this.consumer       = consumer;
        navigator           = consumer.GetComponent <Navigator>();
        prefabid            = consumer.GetComponent <KPrefabID>();
        ownable             = consumer.GetComponent <Ownable>();
        gameObject          = consumer.gameObject;
        solidTransferArm    = consumer.GetComponent <SolidTransferArm>();
        hasSolidTransferArm = ((Object)solidTransferArm != (Object)null);
        resume        = consumer.GetComponent <MinionResume>();
        choreDriver   = consumer.GetComponent <ChoreDriver>();
        schedulable   = consumer.GetComponent <Schedulable>();
        traits        = consumer.GetComponent <Traits>();
        choreProvider = consumer.GetComponent <ChoreProvider>();
        MinionIdentity component = consumer.GetComponent <MinionIdentity>();

        if ((Object)component != (Object)null)
        {
            if (component.assignableProxy == null)
            {
                component.assignableProxy = MinionAssignablesProxy.InitAssignableProxy(component.assignableProxy, component);
            }
            assignables = component.GetSoleOwner();
            equipment   = component.GetEquipment();
        }
        else
        {
            assignables = consumer.GetComponent <Assignables>();
            equipment   = consumer.GetComponent <Equipment>();
        }
        storage            = consumer.GetComponent <Storage>();
        consumableConsumer = consumer.GetComponent <ConsumableConsumer>();
        worker             = consumer.GetComponent <Worker>();
        selectable         = consumer.GetComponent <KSelectable>();
        if ((Object)schedulable != (Object)null)
        {
            int blockIdx = Schedule.GetBlockIdx();
            scheduleBlock = schedulable.GetSchedule().GetBlock(blockIdx);
        }
    }
예제 #18
0
        public ScheduleBlock GetScheduleBlock(Guid id, Guid ruleId, DateTime start)
        {
            ScheduleBlock scheduleBlock = GetScheduleBlock(id);

            if (scheduleBlock != null)
            {
                return(scheduleBlock);
            }

            //TODO: Attempt to get it from db

            // Create new
            ScheduleRule scheduleRule = this.ScheduleRuleList.Find(x => x.Id == ruleId);

            return(new ScheduleBlock()
            {
                Id = id,
                EmployeeId = scheduleRule.EmployeeId,
                Start = start,
                End = new DateTime(start.Year, start.Month, start.Day, scheduleRule.EndHour.Value, scheduleRule.EndMinute.Value, 0),
            });
        }
    private void OnScheduleBlocksTick(object data)
    {
        Schedule      schedule = (Schedule)data;
        ScheduleBlock block    = schedule.GetBlock(Schedule.GetLastBlockIdx());
        ScheduleBlock block2   = schedule.GetBlock(Schedule.GetBlockIdx());
        bool          flag     = block.IsAllowed(Db.Get().ScheduleBlockTypes.Recreation);
        bool          flag2    = block2.IsAllowed(Db.Get().ScheduleBlockTypes.Recreation);

        breakBlocks[Schedule.GetLastBlockIdx()] = flag;
        if (flag && !flag2)
        {
            int num = 0;
            foreach (bool breakBlock in breakBlocks)
            {
                if (breakBlock)
                {
                    num++;
                }
            }
            ApplyBreakBonus(num);
        }
    }
예제 #20
0
    public void Tick()
    {
        ScheduleBlock block  = GetBlock(GetBlockIdx());
        ScheduleBlock block2 = GetBlock(GetLastBlockIdx());

        if (!AreScheduleTypesIdentical(block.allowed_types, block2.allowed_types))
        {
            ScheduleGroup scheduleGroup  = Db.Get().ScheduleGroups.FindGroupForScheduleTypes(block.allowed_types);
            ScheduleGroup scheduleGroup2 = Db.Get().ScheduleGroups.FindGroupForScheduleTypes(block2.allowed_types);
            if (alarmActivated && scheduleGroup2.alarm != scheduleGroup.alarm)
            {
                ScheduleManager.Instance.PlayScheduleAlarm(this, block, scheduleGroup.alarm);
            }
            foreach (Ref <Schedulable> item in GetAssigned())
            {
                item.Get().OnScheduleBlocksChanged(this);
            }
        }
        foreach (Ref <Schedulable> item2 in GetAssigned())
        {
            item2.Get().OnScheduleBlocksTick(this);
        }
    }
        public virtual void Schedule(ScheduleBlock block)
        {
            if (block == null)
            {
                throw new ArgumentNullException(nameof(block));
            }

            var blocklit = new BlockLiteral();

            blocklit.SetupBlock(scheduleBlockProxy, block);
            try
            {
                unsafe
                {
                    var blockref = &blocklit;
                    LibObjc.void_objc_msgSend_IntPtr(this.Handle, selScheduleWithBlock, (IntPtr)blockref);
                }
            }
            finally
            {
                blocklit.CleanupBlock();
            }
        }
    private void Update()
    {
        if (this.CurrentStudent == 100)
        {
            this.UpdateRepChart();
        }
        if (Input.GetButtonDown("A"))
        {
            if (this.StudentInfoMenu.Gossiping)
            {
                this.StudentInfoMenu.PauseScreen.MainMenu.SetActive(true);
                this.StudentInfoMenu.PauseScreen.Show = false;
                this.DialogueWheel.Victim             = this.CurrentStudent;
                this.StudentInfoMenu.Gossiping        = false;
                base.gameObject.SetActive(false);
                Time.timeScale = 1f;
                this.PromptBar.ClearButtons();
                this.PromptBar.Show = false;
            }
            else if (this.StudentInfoMenu.Distracting)
            {
                this.StudentInfoMenu.PauseScreen.MainMenu.SetActive(true);
                this.StudentInfoMenu.PauseScreen.Show = false;
                this.DialogueWheel.Victim             = this.CurrentStudent;
                this.StudentInfoMenu.Distracting      = false;
                base.gameObject.SetActive(false);
                Time.timeScale = 1f;
                this.PromptBar.ClearButtons();
                this.PromptBar.Show = false;
            }
            else if (this.StudentInfoMenu.CyberBullying)
            {
                this.HomeInternet.PostLabels[1].text = this.JSON.Students[this.CurrentStudent].Name;
                this.HomeInternet.Student            = this.CurrentStudent;
                this.StudentInfoMenu.PauseScreen.MainMenu.SetActive(true);
                this.StudentInfoMenu.PauseScreen.Show = false;
                this.StudentInfoMenu.CyberBullying    = false;
                base.gameObject.SetActive(false);
                this.PromptBar.ClearButtons();
                this.PromptBar.Show = false;
            }
            else if (this.StudentInfoMenu.CyberStalking)
            {
                this.HomeInternet.HomeCamera.CyberstalkWindow.SetActive(true);
                this.HomeInternet.Student = this.CurrentStudent;
                this.StudentInfoMenu.PauseScreen.MainMenu.SetActive(true);
                this.StudentInfoMenu.PauseScreen.Show = false;
                this.StudentInfoMenu.CyberStalking    = false;
                base.gameObject.SetActive(false);
                this.PromptBar.ClearButtons();
                this.PromptBar.Show = false;
            }
            else if (this.StudentInfoMenu.MatchMaking)
            {
                this.StudentInfoMenu.PauseScreen.MainMenu.SetActive(true);
                this.StudentInfoMenu.PauseScreen.Show = false;
                this.DialogueWheel.Victim             = this.CurrentStudent;
                this.StudentInfoMenu.MatchMaking      = false;
                base.gameObject.SetActive(false);
                Time.timeScale = 1f;
                this.PromptBar.ClearButtons();
                this.PromptBar.Show = false;
            }
            else if (this.StudentInfoMenu.Targeting)
            {
                this.StudentInfoMenu.PauseScreen.MainMenu.SetActive(true);
                this.StudentInfoMenu.PauseScreen.Show        = false;
                this.Yandere.TargetStudent.HuntTarget        = this.StudentManager.Students[this.CurrentStudent];
                this.Yandere.TargetStudent.HuntTarget.Hunted = true;
                this.Yandere.TargetStudent.GoCommitMurder();
                this.Yandere.RPGCamera.enabled = true;
                this.Yandere.TargetStudent     = null;
                this.StudentInfoMenu.Targeting = false;
                base.gameObject.SetActive(false);
                Time.timeScale = 1f;
                this.PromptBar.ClearButtons();
                this.PromptBar.Show = false;
            }
            else if (this.StudentInfoMenu.SendingHome)
            {
                if (this.CurrentStudent == 10)
                {
                    this.StudentInfoMenu.PauseScreen.ServiceMenu.TextMessageManager.SpawnMessage(10);
                    this.Yandere.Inventory.PantyShots += this.Yandere.PauseScreen.ServiceMenu.ServiceCosts[8];
                    base.gameObject.SetActive(false);
                    this.PromptBar.ClearButtons();
                    this.PromptBar.Label[0].text = string.Empty;
                    this.PromptBar.Label[1].text = "Back";
                    this.PromptBar.UpdateButtons();
                }
                else if (this.StudentManager.Students[this.CurrentStudent].Routine && !this.StudentManager.Students[this.CurrentStudent].InEvent && !this.StudentManager.Students[this.CurrentStudent].TargetedForDistraction && this.StudentManager.Students[this.CurrentStudent].ClubActivityPhase < 16 && !this.StudentManager.Students[this.CurrentStudent].MyBento.Tampered)
                {
                    this.StudentManager.Students[this.CurrentStudent].Routine        = false;
                    this.StudentManager.Students[this.CurrentStudent].SentHome       = true;
                    this.StudentManager.Students[this.CurrentStudent].CameraReacting = false;
                    this.StudentManager.Students[this.CurrentStudent].SpeechLines.Stop();
                    this.StudentManager.Students[this.CurrentStudent].EmptyHands();
                    this.StudentInfoMenu.PauseScreen.ServiceMenu.gameObject.SetActive(true);
                    this.StudentInfoMenu.PauseScreen.ServiceMenu.UpdateList();
                    this.StudentInfoMenu.PauseScreen.ServiceMenu.UpdateDesc();
                    this.StudentInfoMenu.PauseScreen.ServiceMenu.Purchase();
                    this.StudentInfoMenu.SendingHome = false;
                    base.gameObject.SetActive(false);
                    this.PromptBar.ClearButtons();
                    this.PromptBar.Show = false;
                }
                else
                {
                    this.StudentInfoMenu.PauseScreen.ServiceMenu.TextMessageManager.SpawnMessage(0);
                    base.gameObject.SetActive(false);
                    this.PromptBar.ClearButtons();
                    this.PromptBar.Label[0].text = string.Empty;
                    this.PromptBar.Label[1].text = "Back";
                    this.PromptBar.UpdateButtons();
                }
            }
            else if (this.StudentInfoMenu.FindingLocker)
            {
                this.NoteLocker.gameObject.SetActive(true);
                this.NoteLocker.transform.position   = this.StudentManager.Students[this.StudentInfoMenu.StudentID].MyLocker.position;
                this.NoteLocker.transform.position  += new Vector3(0f, 1.355f, 0f);
                this.NoteLocker.transform.position  += this.StudentManager.Students[this.StudentInfoMenu.StudentID].MyLocker.forward * 0.33333f;
                this.NoteLocker.Prompt.Label[0].text = "     Leave note for " + this.StudentManager.Students[this.StudentInfoMenu.StudentID].Name;
                this.NoteLocker.Student        = this.StudentManager.Students[this.StudentInfoMenu.StudentID];
                this.NoteLocker.LockerOwner    = this.StudentInfoMenu.StudentID;
                this.NoteLocker.Prompt.enabled = true;
                this.NoteLocker.transform.GetChild(0).gameObject.SetActive(true);
                this.NoteLocker.CheckingNote = false;
                this.NoteLocker.CanLeaveNote = true;
                this.NoteLocker.SpawnedNote  = false;
                this.NoteLocker.NoteLeft     = false;
                this.NoteLocker.Success      = false;
                this.NoteLocker.Timer        = 0f;
                this.StudentInfoMenu.PauseScreen.MainMenu.SetActive(true);
                this.StudentInfoMenu.PauseScreen.Show = false;
                this.StudentInfoMenu.FindingLocker    = false;
                base.gameObject.SetActive(false);
                this.PromptBar.ClearButtons();
                this.PromptBar.Show            = false;
                this.Yandere.RPGCamera.enabled = true;
                Time.timeScale = 1f;
            }
            else if (this.StudentInfoMenu.FiringCouncilMember)
            {
                if (this.StudentManager.Students[this.CurrentStudent].Routine && !this.StudentManager.Students[this.CurrentStudent].InEvent && !this.StudentManager.Students[this.CurrentStudent].TargetedForDistraction && this.StudentManager.Students[this.CurrentStudent].ClubActivityPhase < 16 && !this.StudentManager.Students[this.CurrentStudent].MyBento.Tampered)
                {
                    this.StudentManager.Students[this.CurrentStudent].OriginalPersona = PersonaType.Heroic;
                    this.StudentManager.Students[this.CurrentStudent].Persona         = PersonaType.Heroic;
                    this.StudentManager.Students[this.CurrentStudent].Club            = ClubType.None;
                    this.StudentManager.Students[this.CurrentStudent].CameraReacting  = false;
                    this.StudentManager.Students[this.CurrentStudent].SpeechLines.Stop();
                    this.StudentManager.Students[this.CurrentStudent].EmptyHands();
                    this.StudentManager.Students[this.CurrentStudent].IdleAnim = this.StudentManager.Students[this.CurrentStudent].BulliedIdleAnim;
                    this.StudentManager.Students[this.CurrentStudent].WalkAnim = this.StudentManager.Students[this.CurrentStudent].BulliedWalkAnim;
                    this.StudentManager.Students[this.CurrentStudent].Armband.SetActive(false);
                    StudentScript studentScript = this.StudentManager.Students[this.CurrentStudent];
                    ScheduleBlock scheduleBlock = studentScript.ScheduleBlocks[3];
                    scheduleBlock.destination = "LunchSpot";
                    scheduleBlock.action      = "Eat";
                    studentScript.GetDestinations();
                    studentScript.CurrentDestination = studentScript.Destinations[studentScript.Phase];
                    studentScript.Pathfinding.target = studentScript.Destinations[studentScript.Phase];
                    this.StudentInfoMenu.PauseScreen.ServiceMenu.gameObject.SetActive(true);
                    this.StudentInfoMenu.PauseScreen.ServiceMenu.UpdateList();
                    this.StudentInfoMenu.PauseScreen.ServiceMenu.UpdateDesc();
                    this.StudentInfoMenu.PauseScreen.ServiceMenu.Purchase();
                    this.StudentInfoMenu.FiringCouncilMember = false;
                    this.StudentInfoMenu.PauseScreen.ServiceMenu.TextMessageManager.SpawnMessage(9);
                }
                else
                {
                    this.StudentInfoMenu.PauseScreen.ServiceMenu.TextMessageManager.SpawnMessage(0);
                }
                base.gameObject.SetActive(false);
                this.PromptBar.ClearButtons();
                this.PromptBar.Label[0].text = string.Empty;
                this.PromptBar.Label[1].text = "Back";
                this.PromptBar.UpdateButtons();
            }
        }
        if (Input.GetButtonDown("B"))
        {
            this.ShowRep = false;
            this.Topics.SetActive(false);
            base.GetComponent <AudioSource>().Stop();
            this.ReputationChart.transform.localScale = new Vector3(0f, 0f, 0f);
            if (this.Shutter != null)
            {
                if (!this.Shutter.PhotoIcons.activeInHierarchy)
                {
                    this.Back = true;
                }
            }
            else
            {
                this.Back = true;
            }
            if (this.Back)
            {
                this.StudentInfoMenu.gameObject.SetActive(true);
                base.gameObject.SetActive(false);
                this.PromptBar.ClearButtons();
                this.PromptBar.Label[0].text = "View Info";
                if (!this.StudentInfoMenu.Gossiping)
                {
                    this.PromptBar.Label[1].text = "Back";
                }
                this.PromptBar.UpdateButtons();
                this.Back = false;
            }
        }
        if (Input.GetButtonDown("X") && this.PromptBar.Button[2].enabled)
        {
            if (this.StudentManager.Tag.Target != this.StudentManager.Students[this.CurrentStudent].Head)
            {
                this.StudentManager.Tag.Target = this.StudentManager.Students[this.CurrentStudent].Head;
                this.PromptBar.Label[2].text   = "Untag";
            }
            else
            {
                this.StudentManager.Tag.Target = null;
                this.PromptBar.Label[2].text   = "Tag";
            }
        }
        if (Input.GetButtonDown("Y") && this.PromptBar.Button[3].enabled)
        {
            if (!this.Topics.activeInHierarchy)
            {
                this.PromptBar.Label[3].text = "Basic Info";
                this.PromptBar.UpdateButtons();
                this.Topics.SetActive(true);
                this.UpdateTopics();
            }
            else
            {
                this.PromptBar.Label[3].text = "Interests";
                this.PromptBar.UpdateButtons();
                this.Topics.SetActive(false);
            }
        }
        if (Input.GetButtonDown("LB"))
        {
            this.UpdateRepChart();
            this.ShowRep = !this.ShowRep;
        }
        if (Input.GetKeyDown(KeyCode.Equals))
        {
            StudentGlobals.SetStudentReputation(this.CurrentStudent, StudentGlobals.GetStudentReputation(this.CurrentStudent) + 10);
            this.UpdateInfo(this.CurrentStudent);
        }
        if (Input.GetKeyDown(KeyCode.Minus))
        {
            StudentGlobals.SetStudentReputation(this.CurrentStudent, StudentGlobals.GetStudentReputation(this.CurrentStudent) - 10);
            this.UpdateInfo(this.CurrentStudent);
        }
        StudentInfoMenuScript studentInfoMenu = this.StudentInfoMenu;

        if (!studentInfoMenu.CyberBullying && !studentInfoMenu.CyberStalking && !studentInfoMenu.FindingLocker && !studentInfoMenu.UsingLifeNote && !studentInfoMenu.GettingInfo && !studentInfoMenu.MatchMaking && !studentInfoMenu.Distracting && !studentInfoMenu.SendingHome && !studentInfoMenu.Gossiping && !studentInfoMenu.Targeting && !studentInfoMenu.Dead)
        {
            if (this.StudentInfoMenu.PauseScreen.InputManager.TappedRight)
            {
                this.CurrentStudent++;
                if (this.CurrentStudent > 100)
                {
                    this.CurrentStudent = 1;
                }
                while (!StudentGlobals.GetStudentPhotographed(this.CurrentStudent))
                {
                    this.CurrentStudent++;
                    if (this.CurrentStudent > 100)
                    {
                        this.CurrentStudent = 1;
                    }
                }
                this.UpdateInfo(this.CurrentStudent);
            }
            if (this.StudentInfoMenu.PauseScreen.InputManager.TappedLeft)
            {
                this.CurrentStudent--;
                if (this.CurrentStudent < 1)
                {
                    this.CurrentStudent = 100;
                }
                while (!StudentGlobals.GetStudentPhotographed(this.CurrentStudent))
                {
                    this.CurrentStudent--;
                    if (this.CurrentStudent < 1)
                    {
                        this.CurrentStudent = 100;
                    }
                }
                this.UpdateInfo(this.CurrentStudent);
            }
        }
        if (this.ShowRep)
        {
            this.ReputationChart.transform.localScale = Vector3.Lerp(this.ReputationChart.transform.localScale, new Vector3(138f, 138f, 138f), Time.unscaledDeltaTime * 10f);
            return;
        }
        this.ReputationChart.transform.localScale = Vector3.Lerp(this.ReputationChart.transform.localScale, new Vector3(0f, 0f, 0f), Time.unscaledDeltaTime * 10f);
    }
예제 #23
0
 public int UpdateScheduleBlock(ScheduleBlock scheduleBlock) // todo make this the message
 {
     return(this.DataContext.SaveChanges());
 }
예제 #24
0
    private void PopulateElements(object data = null)
    {
        refreshHandle.ClearScheduler();
        refreshHandle = UIScheduler.Instance.Schedule("RefreshToDoList", 0.1f, PopulateElements, null, null);
        ListPool <Chore.Precondition.Context, BuildingChoresPanel> .PooledList pooledList = ListPool <Chore.Precondition.Context, BuildingChoresPanel> .Allocate();

        ChoreConsumer.PreconditionSnapshot lastPreconditionSnapshot = choreConsumer.GetLastPreconditionSnapshot();
        if (lastPreconditionSnapshot.doFailedContextsNeedSorting)
        {
            lastPreconditionSnapshot.failedContexts.Sort();
            lastPreconditionSnapshot.doFailedContextsNeedSorting = false;
        }
        pooledList.AddRange(lastPreconditionSnapshot.failedContexts);
        pooledList.AddRange(lastPreconditionSnapshot.succeededContexts);
        Chore.Precondition.Context choreB = default(Chore.Precondition.Context);
        MinionTodoChoreEntry       minionTodoChoreEntry = null;
        int         num       = 0;
        Schedulable component = DetailsScreen.Instance.target.GetComponent <Schedulable>();
        string      arg       = string.Empty;
        Schedule    schedule  = component.GetSchedule();

        if (schedule != null)
        {
            ScheduleBlock block = schedule.GetBlock(Schedule.GetBlockIdx());
            arg = block.name;
        }
        currentScheduleBlockLabel.SetText(string.Format(UI.UISIDESCREENS.MINIONTODOSIDESCREEN.CURRENT_SCHEDULE_BLOCK, arg));
        choreTargets.Clear();
        bool flag = false;

        activeChoreEntries = 0;
        for (int num2 = pooledList.Count - 1; num2 >= 0; num2--)
        {
            Chore.Precondition.Context context = pooledList[num2];
            if (context.chore != null)
            {
                Chore.Precondition.Context context2 = pooledList[num2];
                if (!context2.chore.target.isNull)
                {
                    Chore.Precondition.Context context3 = pooledList[num2];
                    if (!((UnityEngine.Object)context3.chore.target.gameObject == (UnityEngine.Object)null) && pooledList[num2].IsPotentialSuccess())
                    {
                        Chore.Precondition.Context context4 = pooledList[num2];
                        if ((UnityEngine.Object)context4.chore.driver == (UnityEngine.Object)choreConsumer.choreDriver)
                        {
                            currentTask.Apply(pooledList[num2]);
                            minionTodoChoreEntry = currentTask;
                            choreB = pooledList[num2];
                            num    = 0;
                            flag   = true;
                        }
                        else if (!flag && activeChoreEntries != 0 && GameUtil.AreChoresUIMergeable(pooledList[num2], choreB))
                        {
                            num++;
                            minionTodoChoreEntry.SetMoreAmount(num);
                        }
                        else
                        {
                            ChoreConsumer obj = choreConsumer;
                            Chore.Precondition.Context context5            = pooledList[num2];
                            HierarchyReferences        hierarchyReferences = PriorityGroupForPriority(obj, context5.chore);
                            MinionTodoChoreEntry       choreEntry          = GetChoreEntry(hierarchyReferences.GetReference <RectTransform>("EntriesContainer"));
                            choreEntry.Apply(pooledList[num2]);
                            minionTodoChoreEntry = choreEntry;
                            choreB = pooledList[num2];
                            num    = 0;
                            flag   = false;
                        }
                    }
                }
            }
        }
        pooledList.Recycle();
        for (int num3 = choreEntries.Count - 1; num3 >= activeChoreEntries; num3--)
        {
            choreEntries[num3].gameObject.SetActive(false);
        }
        foreach (Tuple <PriorityScreen.PriorityClass, int, HierarchyReferences> priorityGroup in priorityGroups)
        {
            RectTransform reference = priorityGroup.third.GetReference <RectTransform>("EntriesContainer");
            priorityGroup.third.gameObject.SetActive(reference.childCount > 0);
        }
    }
 // Token: 0x06001272 RID: 4722 RVA: 0x00086DB4 File Offset: 0x00084FB4
 private void Update()
 {
     if (this.Zoom)
     {
         this.MainCamera.transform.localPosition = Vector3.Lerp(this.MainCamera.transform.localPosition, new Vector3(1.5f, 0.25f, -0.5f), Time.deltaTime * 2f);
         this.RedVignette.color = Vector4.Lerp(this.RedVignette.color, new Color(1f, 1f, 1f, 1f - (float)this.Yandere.Health * 1f / 10f), Time.deltaTime);
         if (this.Timer < 1f)
         {
             this.Delinquent.MoveTowardsTarget(this.Yandere.transform.position + this.Yandere.transform.forward);
         }
         this.Timer += Time.deltaTime;
         this.AdjustMidpoint();
         if (this.Timer > 1.5f)
         {
             Debug.Log(base.name + " is being instructed to perform the first combat animation of the combat minigame.");
             this.Delinquent.CharacterAnimation.CrossFade(this.Prefix + "Delinquent_CombatA");
             this.Yandere.CharacterAnimation.CrossFade("Yandere_CombatA");
             this.CameraStart  = this.MainCamera.localPosition;
             this.Label.text   = "State: A";
             this.Zoom         = false;
             this.Timer        = 0f;
             this.Phase        = 1;
             this.Path         = 1;
             this.MyAudio.clip = this.CombatSFX[this.Phase];
             this.MyAudio.Play();
             this.MyVocals.clip = this.Vocals[this.Phase];
             this.MyVocals.Play();
         }
     }
     if (this.Phase > 0)
     {
         this.MainCamera.position += new Vector3(this.Shake * UnityEngine.Random.Range(-1f, 1f), this.Shake * UnityEngine.Random.Range(-1f, 1f), this.Shake * UnityEngine.Random.Range(-1f, 1f));
         this.Shake = Mathf.Lerp(this.Shake, 0f, Time.deltaTime * 10f);
         this.AdjustMidpoint();
     }
     if (this.ButtonID > 0)
     {
         this.Timer            += Time.deltaTime;
         this.Circle.fillAmount = 1f - this.Timer / 0.33333f;
         if ((Input.GetButtonDown("A") && this.CurrentButton != "A") || (Input.GetButtonDown("B") && this.CurrentButton != "B") || (Input.GetButtonDown("X") && this.CurrentButton != "X") || (Input.GetButtonDown("Y") && this.CurrentButton != "Y"))
         {
             Time.timeScale      = 1f;
             this.MyVocals.pitch = 1f;
             this.MyAudio.pitch  = 1f;
             this.DisablePrompts();
             this.Phase++;
         }
         else if (Input.GetButtonDown(this.CurrentButton))
         {
             this.Success = true;
         }
     }
     if (this.Path == 1)
     {
         if (!this.Delinquent.CharacterAnimation.IsPlaying(this.Prefix + "Delinquent_CombatA"))
         {
             this.Delinquent.CharacterAnimation.CrossFade(this.Prefix + "Delinquent_CombatA");
             this.Delinquent.CharacterAnimation[this.Prefix + "Delinquent_CombatA"].time = this.Yandere.CharacterAnimation["Yandere_CombatA"].time;
         }
         this.MainCamera.localPosition = Vector3.Lerp(this.MainCamera.localPosition, this.CameraStart, Time.deltaTime);
         if (this.Phase == 1)
         {
             if (this.Yandere.CharacterAnimation["Yandere_CombatA"].time > 1f)
             {
                 this.StartTime = this.Yandere.CharacterAnimation["Yandere_CombatA"].time - 1f;
                 this.ChooseButton();
                 this.Slowdown();
                 this.Phase++;
                 return;
             }
         }
         else if (this.Phase == 2)
         {
             if (this.Yandere.CharacterAnimation["Yandere_CombatA"].time > 1.33333f)
             {
                 Time.timeScale      = 1f;
                 this.MyVocals.pitch = 1f;
                 this.MyAudio.pitch  = 1f;
                 this.DisablePrompts();
                 this.Phase++;
                 return;
             }
             if (this.Success)
             {
                 this.Delinquent.CharacterAnimation[this.Prefix + "Delinquent_CombatB"].time = this.Delinquent.CharacterAnimation[this.Prefix + "Delinquent_CombatA"].time;
                 this.Yandere.CharacterAnimation["Yandere_CombatB"].time = this.Yandere.CharacterAnimation["Yandere_CombatA"].time;
                 this.Delinquent.CharacterAnimation.Play(this.Prefix + "Delinquent_CombatB");
                 this.Yandere.CharacterAnimation.Play("Yandere_CombatB");
                 this.Label.text    = "State: B";
                 Time.timeScale     = 1f;
                 this.MyAudio.pitch = 1f;
                 this.DisablePrompts();
                 this.Strike = 0;
                 this.Path   = 2;
                 this.Phase++;
                 this.MyAudio.clip = this.CombatSFX[this.Path];
                 this.MyAudio.time = this.Yandere.CharacterAnimation["Yandere_CombatB"].time;
                 this.MyAudio.Play();
                 this.MyVocals.clip = this.Vocals[this.Path];
                 this.MyVocals.time = this.Yandere.CharacterAnimation["Yandere_CombatB"].time + 0.5f;
                 this.MyVocals.Play();
                 return;
             }
         }
         else if (this.Phase == 3)
         {
             if (this.Strike < 1)
             {
                 if (this.Yandere.CharacterAnimation["Yandere_CombatA"].time > 1.66666f)
                 {
                     UnityEngine.Object.Instantiate <GameObject>(this.HitEffect, this.Yandere.LeftArmRoll.position, Quaternion.identity);
                     this.Shake += this.ShakeFactor;
                     this.Strike++;
                     this.Yandere.Health--;
                     this.RedVignette.color = new Color(1f, 1f, 1f, 1f - (float)this.Yandere.Health * 1f / 10f);
                 }
             }
             else if (this.Strike < 2 && this.Yandere.CharacterAnimation["Yandere_CombatA"].time > 2.5f)
             {
                 UnityEngine.Object.Instantiate <GameObject>(this.HitEffect, this.Yandere.RightArmRoll.position, Quaternion.identity);
                 this.Shake += this.ShakeFactor;
                 this.Strike++;
                 this.Yandere.Health--;
                 if (this.Yandere.Health < 0)
                 {
                     this.Yandere.Health = 0;
                 }
                 this.RedVignette.color = new Color(1f, 1f, 1f, 1f - (float)this.Yandere.Health * 1f / 10f);
                 if (!this.Practice)
                 {
                     this.Yandere.MyRenderer.materials[2].SetFloat("_BlendAmount1", 1f - (float)this.Yandere.Health * 1f / 10f);
                 }
                 if (this.Yandere.Health < 1)
                 {
                     if (!this.Delinquent.WitnessedMurder && !this.Delinquent.WitnessedCorpse)
                     {
                         this.Delinquent.CharacterAnimation[this.Prefix + "Delinquent_CombatF"].time = this.Delinquent.CharacterAnimation[this.Prefix + "Delinquent_CombatA"].time;
                         this.Yandere.CharacterAnimation["Yandere_CombatF"].time = this.Yandere.CharacterAnimation["Yandere_CombatA"].time;
                         this.Delinquent.CharacterAnimation.CrossFade(this.Prefix + "Delinquent_CombatF");
                         this.Yandere.CharacterAnimation.CrossFade("Yandere_CombatF");
                         this.Shake         += this.ShakeFactor;
                         this.Label.text     = "State: F";
                         Time.timeScale      = 1f;
                         this.MyVocals.pitch = 1f;
                         this.MyAudio.pitch  = 1f;
                         this.DisablePrompts();
                         this.Timer = 0f;
                         this.Path  = 6;
                         this.Phase++;
                         this.MyAudio.clip = this.CombatSFX[this.Path];
                         this.MyAudio.time = this.Yandere.CharacterAnimation["Yandere_CombatF"].time;
                         this.MyAudio.Play();
                         this.MyVocals.clip = this.Vocals[this.Path];
                         this.MyVocals.time = this.Yandere.CharacterAnimation["Yandere_CombatF"].time;
                         this.MyVocals.Play();
                     }
                     else
                     {
                         this.Delinquent.CharacterAnimation[this.Prefix + "Delinquent_CombatE"].time = this.Delinquent.CharacterAnimation[this.Prefix + "Delinquent_CombatA"].time;
                         this.Yandere.CharacterAnimation["Yandere_CombatE"].time = this.Yandere.CharacterAnimation["Yandere_CombatA"].time;
                         this.Delinquent.CharacterAnimation.CrossFade(this.Prefix + "Delinquent_CombatE");
                         this.Yandere.CharacterAnimation.CrossFade("Yandere_CombatE");
                         this.CameraTarget      = this.MainCamera.position + new Vector3(0f, 1f, 0f);
                         this.MainCamera.parent = null;
                         this.Shake            += this.ShakeFactor;
                         this.KnockedOut        = true;
                         this.Label.text        = "State: E";
                         Time.timeScale         = 1f;
                         this.MyVocals.pitch    = 1f;
                         this.MyAudio.pitch     = 1f;
                         this.DisablePrompts();
                         this.Timer = 0f;
                         this.Path  = 5;
                         this.Phase++;
                         this.MyAudio.clip = this.CombatSFX[this.Path];
                         this.MyAudio.time = this.Yandere.CharacterAnimation["Yandere_CombatE"].time;
                         this.MyAudio.Play();
                         this.MyVocals.clip = this.Vocals[this.Path];
                         this.MyVocals.time = this.Yandere.CharacterAnimation["Yandere_CombatE"].time;
                         this.MyVocals.Play();
                     }
                 }
             }
             if (this.Yandere.CharacterAnimation["Yandere_CombatA"].time > this.Yandere.CharacterAnimation["Yandere_CombatA"].length)
             {
                 this.Delinquent.CharacterAnimation[this.Prefix + "Delinquent_CombatA"].time = 0f;
                 this.Yandere.CharacterAnimation["Yandere_CombatA"].time = 0f;
                 this.Label.text   = "State: A";
                 this.Strike       = 0;
                 this.Phase        = 1;
                 this.MyAudio.clip = this.CombatSFX[this.Path];
                 this.MyAudio.time = this.Yandere.CharacterAnimation["Yandere_CombatA"].time;
                 this.MyAudio.Play();
                 this.MyVocals.clip = this.Vocals[this.Path];
                 this.MyVocals.time = this.Yandere.CharacterAnimation["Yandere_CombatA"].time;
                 this.MyVocals.Play();
                 return;
             }
         }
     }
     else if (this.Path == 2)
     {
         if (this.Phase == 3)
         {
             if (this.Yandere.CharacterAnimation["Yandere_CombatB"].time > 1.833333f)
             {
                 this.StartTime = this.Yandere.CharacterAnimation["Yandere_CombatB"].time - 1.833333f;
                 this.ChooseButton();
                 this.Slowdown();
                 this.Phase++;
                 return;
             }
         }
         else if (this.Phase == 4)
         {
             if (this.Yandere.CharacterAnimation["Yandere_CombatB"].time > 2.166666f)
             {
                 Time.timeScale      = 1f;
                 this.MyVocals.pitch = 1f;
                 this.MyAudio.pitch  = 1f;
                 this.DisablePrompts();
                 this.Phase++;
                 return;
             }
             if (this.Success)
             {
                 this.Delinquent.CharacterAnimation[this.Prefix + "Delinquent_CombatC"].time = this.Delinquent.CharacterAnimation[this.Prefix + "Delinquent_CombatB"].time;
                 this.Yandere.CharacterAnimation["Yandere_CombatC"].time = this.Yandere.CharacterAnimation["Yandere_CombatB"].time;
                 this.Delinquent.CharacterAnimation.Play(this.Prefix + "Delinquent_CombatC");
                 this.Yandere.CharacterAnimation.Play("Yandere_CombatC");
                 this.Label.text     = "State: C";
                 Time.timeScale      = 1f;
                 this.MyVocals.pitch = 1f;
                 this.MyAudio.pitch  = 1f;
                 this.DisablePrompts();
                 this.Strike = 0;
                 this.Path   = 3;
                 this.Phase++;
                 this.MyAudio.clip = this.CombatSFX[this.Path];
                 this.MyAudio.time = this.Yandere.CharacterAnimation["Yandere_CombatC"].time;
                 this.MyAudio.Play();
                 this.MyVocals.clip = this.Vocals[this.Path];
                 this.MyVocals.time = this.Yandere.CharacterAnimation["Yandere_CombatC"].time;
                 this.MyVocals.Play();
                 return;
             }
         }
         else if (this.Phase == 5)
         {
             if (this.Strike < 1 && this.Yandere.CharacterAnimation["Yandere_CombatB"].time > 2.66666f)
             {
                 UnityEngine.Object.Instantiate <GameObject>(this.HitEffect, this.Delinquent.LeftHand.position, Quaternion.identity);
                 this.Shake += this.ShakeFactor;
                 this.Strike++;
             }
             if (this.Yandere.CharacterAnimation["Yandere_CombatB"].time > this.Yandere.CharacterAnimation["Yandere_CombatB"].length)
             {
                 this.Delinquent.CharacterAnimation.CrossFade(this.Prefix + "Delinquent_CombatA");
                 this.Yandere.CharacterAnimation.CrossFade("Yandere_CombatA");
                 this.Label.text   = "State: A";
                 this.Strike       = 0;
                 this.Phase        = 1;
                 this.Path         = 1;
                 this.MyAudio.clip = this.CombatSFX[this.Path];
                 this.MyAudio.time = this.Yandere.CharacterAnimation["Yandere_CombatA"].time;
                 this.MyAudio.Play();
                 this.MyVocals.clip = this.Vocals[this.Path];
                 this.MyVocals.time = this.Yandere.CharacterAnimation["Yandere_CombatA"].time;
                 this.MyVocals.Play();
                 return;
             }
         }
     }
     else if (this.Path == 3)
     {
         if (this.Phase == 5)
         {
             if (this.Strike < 1 && this.Yandere.CharacterAnimation["Yandere_CombatC"].time > 2.5f)
             {
                 UnityEngine.Object.Instantiate <GameObject>(this.HitEffect, this.Yandere.RightHand.position, Quaternion.identity);
                 this.Shake += this.ShakeFactor;
                 this.Strike++;
             }
             if (this.Yandere.CharacterAnimation["Yandere_CombatC"].time > 3.166666f)
             {
                 this.StartTime = this.Yandere.CharacterAnimation["Yandere_CombatC"].time - 3.166666f;
                 this.ChooseButton();
                 this.Slowdown();
                 this.Phase++;
                 return;
             }
         }
         else if (this.Phase == 6)
         {
             if (this.Yandere.CharacterAnimation["Yandere_CombatC"].time > 3.5f)
             {
                 this.DisablePrompts();
                 Time.timeScale      = 1f;
                 this.MyVocals.pitch = 1f;
                 this.MyAudio.pitch  = 1f;
                 this.Phase++;
                 return;
             }
             if (this.Success)
             {
                 this.Delinquent.CharacterAnimation[this.Prefix + "Delinquent_CombatD"].time = this.Delinquent.CharacterAnimation[this.Prefix + "Delinquent_CombatC"].time;
                 this.Yandere.CharacterAnimation["Yandere_CombatD"].time = this.Yandere.CharacterAnimation["Yandere_CombatC"].time;
                 this.Delinquent.CharacterAnimation.Play(this.Prefix + "Delinquent_CombatD");
                 this.Yandere.CharacterAnimation.Play("Yandere_CombatD");
                 this.Label.text     = "State: D";
                 Time.timeScale      = 1f;
                 this.MyVocals.pitch = 1f;
                 this.MyAudio.pitch  = 1f;
                 this.DisablePrompts();
                 this.Strike = 0;
                 this.Path   = 4;
                 this.Phase++;
                 this.MyAudio.clip = this.CombatSFX[this.Path];
                 this.MyAudio.time = this.Yandere.CharacterAnimation["Yandere_CombatD"].time;
                 this.MyAudio.Play();
                 this.MyVocals.clip = this.Vocals[this.Path];
                 this.MyVocals.time = this.Yandere.CharacterAnimation["Yandere_CombatD"].time;
                 this.MyVocals.Play();
                 return;
             }
         }
         else if (this.Phase == 7 && this.Yandere.CharacterAnimation["Yandere_CombatC"].time > this.Yandere.CharacterAnimation["Yandere_CombatC"].length)
         {
             this.Delinquent.CharacterAnimation.CrossFade(this.Prefix + "Delinquent_CombatA");
             this.Yandere.CharacterAnimation.CrossFade("Yandere_CombatA");
             this.Label.text   = "State: A";
             this.Strike       = 0;
             this.Phase        = 1;
             this.Path         = 1;
             this.MyAudio.clip = this.CombatSFX[this.Path];
             this.MyAudio.time = this.Yandere.CharacterAnimation["Yandere_CombatA"].time;
             this.MyAudio.Play();
             this.MyVocals.clip = this.Vocals[this.Path];
             this.MyVocals.time = this.Yandere.CharacterAnimation["Yandere_CombatA"].time;
             this.MyVocals.Play();
             return;
         }
     }
     else if (this.Path == 4)
     {
         if (this.Phase == 7)
         {
             if (this.Strike < 1)
             {
                 if (this.Yandere.CharacterAnimation["Yandere_CombatD"].time > 4f)
                 {
                     UnityEngine.Object.Instantiate <GameObject>(this.HitEffect, this.Yandere.RightKnee.position, Quaternion.identity);
                     if (!this.Delinquent.WitnessedMurder && !this.Delinquent.WitnessedCorpse)
                     {
                         this.Delinquent.MyWeapon.transform.parent     = null;
                         this.Delinquent.MyWeapon.MyCollider.enabled   = true;
                         this.Delinquent.MyWeapon.MyCollider.isTrigger = false;
                         this.Delinquent.MyWeapon.Prompt.enabled       = true;
                         this.Delinquent.IgnoreBlood = true;
                         Rigidbody component = this.Delinquent.MyWeapon.GetComponent <Rigidbody>();
                         component.constraints = RigidbodyConstraints.None;
                         component.isKinematic = false;
                         component.useGravity  = true;
                         if (!this.Practice)
                         {
                             this.Delinquent.MyWeapon = null;
                         }
                     }
                     this.Shake += this.ShakeFactor;
                     this.Strike++;
                 }
             }
             else if (this.Yandere.CharacterAnimation["Yandere_CombatD"].time > 5.5f)
             {
                 this.MainCamera.transform.parent = null;
                 this.Strength += Time.deltaTime;
                 this.MainCamera.transform.position = Vector3.Lerp(this.MainCamera.transform.position, this.StartPoint, Time.deltaTime * this.Strength);
                 this.RedVignette.color             = Vector4.Lerp(this.RedVignette.color, new Vector4(1f, 0f, 0f, 0f), Time.deltaTime * this.Strength);
                 this.Zoom = false;
             }
             if (this.Yandere.CharacterAnimation["Yandere_CombatD"].time > this.Yandere.CharacterAnimation["Yandere_CombatD"].length)
             {
                 if (this.Delinquent.WitnessedMurder || this.Delinquent.WitnessedCorpse)
                 {
                     this.Yandere.Subtitle.UpdateLabel(SubtitleType.DelinquentNoSurrender, 0, 5f);
                     if (!this.Delinquent.WillChase)
                     {
                         this.Delinquent.WillChase = true;
                         this.Yandere.Chasers++;
                     }
                 }
                 else if (!this.Practice)
                 {
                     this.Yandere.Subtitle.UpdateLabel(SubtitleType.DelinquentSurrender, 0, 5f);
                     this.Delinquent.Persona = PersonaType.Loner;
                 }
                 if (!this.Practice)
                 {
                     ScheduleBlock scheduleBlock = this.Delinquent.ScheduleBlocks[2];
                     scheduleBlock.destination = "Sulk";
                     scheduleBlock.action      = "Sulk";
                     ScheduleBlock scheduleBlock2 = this.Delinquent.ScheduleBlocks[4];
                     scheduleBlock2.destination = "Sulk";
                     scheduleBlock2.action      = "Sulk";
                     ScheduleBlock scheduleBlock3 = this.Delinquent.ScheduleBlocks[6];
                     scheduleBlock3.destination = "Sulk";
                     scheduleBlock3.action      = "Sulk";
                     ScheduleBlock scheduleBlock4 = this.Delinquent.ScheduleBlocks[7];
                     scheduleBlock4.destination = "Sulk";
                     scheduleBlock4.action      = "Sulk";
                     this.Delinquent.GetDestinations();
                     this.Delinquent.CurrentDestination = this.Delinquent.Destinations[this.Delinquent.Phase];
                     this.Delinquent.Pathfinding.target = this.Delinquent.Destinations[this.Delinquent.Phase];
                     this.Delinquent.IdleAnim           = "idleInjured_00";
                     this.Delinquent.WalkAnim           = "walkInjured_00";
                     this.Delinquent.OriginalIdleAnim   = this.Delinquent.IdleAnim;
                     this.Delinquent.OriginalWalkAnim   = this.Delinquent.WalkAnim;
                     this.Delinquent.LeanAnim           = this.Delinquent.IdleAnim;
                     this.Delinquent.CharacterAnimation.CrossFade(this.Delinquent.IdleAnim);
                     this.Delinquent.Threatened = true;
                     this.Delinquent.Alarmed    = true;
                     this.Delinquent.Injured    = true;
                     this.Delinquent.Strength   = 0;
                     this.Delinquent.Defeats++;
                 }
                 else
                 {
                     this.Delinquent.Threatened = false;
                     this.Delinquent.Alarmed    = false;
                     this.PracticeWindow.Finish();
                     this.Yandere.Health = 10;
                     this.Practice       = false;
                 }
                 this.Delinquent.Fighting   = false;
                 this.Delinquent.enabled    = true;
                 this.Delinquent.Distracted = false;
                 this.Delinquent.Shoving    = false;
                 this.Delinquent.Paired     = false;
                 this.Delinquent            = null;
                 this.ReleaseYandere();
                 this.ResetValues();
                 this.Yandere.StudentManager.UpdateStudents(0);
                 return;
             }
         }
     }
     else if (this.Path == 5)
     {
         if (this.Phase == 4)
         {
             this.MainCamera.position = Vector3.Lerp(this.MainCamera.position, this.CameraTarget, Time.deltaTime);
             if (this.Yandere.CharacterAnimation["Yandere_CombatE"].time > this.Yandere.CharacterAnimation["Yandere_CombatE"].length)
             {
                 this.Timer += Time.deltaTime;
                 if (this.Timer > 1f)
                 {
                     this.Yandere.ShoulderCamera.HeartbrokenCamera.SetActive(true);
                     this.Yandere.ShoulderCamera.enabled = false;
                     this.Yandere.RPGCamera.enabled      = false;
                     this.Yandere.Jukebox.GameOver();
                     this.Yandere.enabled = false;
                     this.Yandere.EmptyHands();
                     this.Yandere.Lost = true;
                     this.Phase++;
                     return;
                 }
             }
         }
     }
     else if (this.Path == 6)
     {
         if (this.Phase == 4)
         {
             if (this.Yandere.CharacterAnimation["Yandere_CombatF"].time > 6.33333f)
             {
                 this.MainCamera.transform.parent = null;
                 this.Strength += Time.deltaTime;
                 this.MainCamera.transform.position = Vector3.Lerp(this.MainCamera.transform.position, this.StartPoint, Time.deltaTime * this.Strength);
                 this.RedVignette.color             = Vector4.Lerp(this.RedVignette.color, new Vector4(1f, 0f, 0f, 0f), Time.deltaTime * this.Strength);
                 this.Zoom = false;
             }
             if (this.Delinquent.CharacterAnimation[this.Prefix + "Delinquent_CombatF"].time > 7.83333f)
             {
                 this.Delinquent.MyWeapon.transform.parent           = this.Delinquent.WeaponBagParent;
                 this.Delinquent.MyWeapon.transform.localEulerAngles = new Vector3(0f, 0f, 0f);
                 this.Delinquent.MyWeapon.transform.localPosition    = new Vector3(0f, 0f, 0f);
             }
             if (this.Yandere.CharacterAnimation["Yandere_CombatF"].time > this.Yandere.CharacterAnimation["Yandere_CombatF"].length)
             {
                 if (!this.Practice)
                 {
                     this.Yandere.Subtitle.UpdateLabel(SubtitleType.DelinquentWin, 0, 5f);
                     this.Yandere.IdleAnim         = "f02_idleInjured_00";
                     this.Yandere.WalkAnim         = "f02_walkInjured_00";
                     this.Yandere.OriginalIdleAnim = this.Yandere.IdleAnim;
                     this.Yandere.OriginalWalkAnim = this.Yandere.WalkAnim;
                     this.Yandere.StudentManager.Rest.Prompt.enabled = true;
                 }
                 else
                 {
                     this.PracticeWindow.Finish();
                     this.Yandere.Health = 10;
                     this.Practice       = false;
                 }
                 this.Yandere.CharacterAnimation.CrossFade(this.Yandere.IdleAnim);
                 this.Yandere.DelinquentFighting = false;
                 this.Yandere.RPGCamera.enabled  = true;
                 this.Yandere.CannotRecover      = false;
                 this.Yandere.CanMove            = true;
                 this.Yandere.Chased             = false;
                 this.Delinquent.Threatened      = false;
                 this.Delinquent.Fighting        = false;
                 this.Delinquent.Injured         = false;
                 this.Delinquent.Alarmed         = false;
                 this.Delinquent.Routine         = true;
                 this.Delinquent.enabled         = true;
                 this.Delinquent.Distracted      = false;
                 this.Delinquent.Shoving         = false;
                 this.Delinquent.Paired          = false;
                 this.Delinquent.Patience        = 5;
                 this.ResetValues();
                 this.Yandere.StudentManager.UpdateStudents(0);
                 return;
             }
         }
     }
     else if (this.Path == 7)
     {
         if (this.Yandere.CharacterAnimation["f02_stopFighting_00"].time > 1f)
         {
             this.MainCamera.transform.parent = null;
             this.Strength += Time.deltaTime;
             this.MainCamera.transform.position = Vector3.Lerp(this.MainCamera.transform.position, this.StartPoint, Time.deltaTime * this.Strength);
             this.RedVignette.color             = Vector4.Lerp(this.RedVignette.color, new Vector4(1f, 0f, 0f, 0f), Time.deltaTime * this.Strength);
             this.Zoom = false;
         }
         if (this.Delinquent.CharacterAnimation["stopFighting_00"].time > 3.83333f)
         {
             this.Delinquent.MyWeapon.transform.parent           = this.Delinquent.WeaponBagParent;
             this.Delinquent.MyWeapon.transform.localEulerAngles = new Vector3(0f, 0f, 0f);
             this.Delinquent.MyWeapon.transform.localPosition    = new Vector3(0f, 0f, 0f);
         }
         if (this.Yandere.CharacterAnimation["f02_stopFighting_00"].time > this.Yandere.CharacterAnimation["f02_stopFighting_00"].length)
         {
             this.Delinquent.GetDestinations();
             this.Delinquent.CurrentDestination = this.Delinquent.Destinations[this.Delinquent.Phase];
             this.Delinquent.Pathfinding.target = this.Delinquent.Destinations[this.Delinquent.Phase];
             this.ReleaseYandere();
             this.Delinquent.Threatened = false;
             this.Delinquent.Fighting   = false;
             this.Delinquent.Alarmed    = false;
             this.Delinquent.enabled    = true;
             this.Delinquent.Distracted = false;
             this.Delinquent.Shoving    = false;
             this.Delinquent.Paired     = false;
             this.Delinquent.Routine    = true;
             this.Delinquent.Patience   = 5;
             this.Delinquent            = null;
             this.DisablePrompts();
             this.ResetValues();
             this.Yandere.StudentManager.UpdateStudents(0);
         }
     }
 }