123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250 |
- using System;
- using System.Collections.Generic;
- using MaidStatus;
- using MaidStatus.CsvData;
- using UnityEngine;
- using wf;
- public class CompetitiveShowMgr : BasePanelMgr
- {
- public static bool compatibilityMode
- {
- get
- {
- return DailyMgr.IsLegacy;
- }
- }
- public static bool IsCompetitiveShowChara()
- {
- return 0 < CompetitiveShowMgr.check_maid_list.Count;
- }
- public override void Init()
- {
- if (CompetitiveShowMgr.check_maid_list.Count <= 0)
- {
- for (int i = 0; i < SceneCharacterSelect.select_maid_list.Count; i++)
- {
- CompetitiveShowMgr.check_maid_list.Add(SceneCharacterSelect.select_maid_list[i]);
- }
- SceneCharacterSelect.select_maid_list.Clear();
- if (1 < CompetitiveShowMgr.check_maid_list.Count)
- {
- GameMain.Instance.MainCamera.FadeOutNoUI(0f, true);
- GameMain.Instance.MainCamera.FadeIn(0f, false, null, true, true, default(Color));
- GameMain.Instance.SysDlg.Show("演出を簡略化しますか?", SystemDialog.TYPE.YES_NO, delegate
- {
- CompetitiveShowMgr.is_effect_ones = true;
- GameMain.Instance.CMSystem.SetTmpGenericFlag("品評会_演出省略", 1);
- GameMain.Instance.SysDlg.Close();
- GameMain.Instance.MainCamera.FadeInNoUI(0f, true);
- GameMain.Instance.MainCamera.FadeOut(0f, false, null, true, default(Color));
- this.Start2();
- }, delegate
- {
- CompetitiveShowMgr.is_effect_ones = false;
- GameMain.Instance.CMSystem.SetTmpGenericFlag("品評会_演出省略", 0);
- GameMain.Instance.SysDlg.Close();
- GameMain.Instance.MainCamera.FadeInNoUI(0f, true);
- GameMain.Instance.MainCamera.FadeOut(0f, false, null, true, default(Color));
- this.Start2();
- });
- }
- else
- {
- CompetitiveShowMgr.is_effect_ones = false;
- GameMain.Instance.CMSystem.SetTmpGenericFlag("品評会_演出省略", 0);
- this.Start2();
- }
- }
- else
- {
- this.Start2();
- }
- }
- protected override void Start()
- {
- NDebug.AssertNull(this.ClassEffect != null);
- this.ClassEffect.SetActive(false);
- this.is_success = false;
- base.Start();
- this.Init();
- }
- private void Start2()
- {
- Dictionary<int, string> dictionary = new Dictionary<int, string>();
- Dictionary<int, string> dictionary2 = new Dictionary<int, string>();
- List<JobClass.Data> allDatas = JobClass.GetAllDatas(true);
- List<YotogiClass.Data> allDatas2 = YotogiClass.GetAllDatas(true);
- bool lockNTRPlay = GameMain.Instance.CharacterMgr.status.lockNTRPlay;
- Maid maid = null;
- int num = 0;
- while (num < CompetitiveShowMgr.check_maid_list.Count && !this.is_success)
- {
- if (!CompetitiveShowMgr.is_effect_ones && 1 <= num)
- {
- break;
- }
- Maid maid2 = CompetitiveShowMgr.check_maid_list[num];
- AbstractClassData.ClassType classType = AbstractClassData.ClassType.Share;
- classType |= ((!CompetitiveShowMgr.compatibilityMode) ? AbstractClassData.ClassType.New : AbstractClassData.ClassType.Old);
- bool flag = maid2.status.jobClass.GetLearnPossibleClassDatas(true, classType).Count != 0;
- if (!flag)
- {
- List<YotogiClass.Data> learnPossibleClassDatas = maid2.status.yotogiClass.GetLearnPossibleClassDatas(true, classType);
- if (lockNTRPlay)
- {
- List<YotogiClass.Data> list = new List<YotogiClass.Data>();
- foreach (YotogiClass.Data data in learnPossibleClassDatas)
- {
- if (YotogiClass.IsNTRClass(data.id, CompetitiveShowMgr.compatibilityMode))
- {
- list.Add(data);
- }
- }
- foreach (YotogiClass.Data item in list)
- {
- learnPossibleClassDatas.Remove(item);
- }
- }
- flag = (learnPossibleClassDatas.Count != 0);
- }
- if (flag)
- {
- this.is_success = true;
- if (maid == null)
- {
- maid = maid2;
- break;
- }
- }
- num++;
- }
- if (maid == null && 0 < CompetitiveShowMgr.check_maid_list.Count)
- {
- maid = CompetitiveShowMgr.check_maid_list[0];
- }
- if (CompetitiveShowMgr.is_effect_ones)
- {
- this.sceneMgr.GetManager<MaidExaminationMgr>().OpenMaidExaminationPanel(maid, CompetitiveShowMgr.check_maid_list, new CompetitiveShowAPI.dgOnSceneStartCallBack(this.OnFadeInEnd));
- }
- else
- {
- this.sceneMgr.GetManager<MaidExaminationMgr>().OpenMaidExaminationPanel(maid, new List<Maid>
- {
- CompetitiveShowMgr.check_maid_list[0]
- }, new CompetitiveShowAPI.dgOnSceneStartCallBack(this.OnFadeInEnd));
- }
- }
- private void OnFadeInEnd()
- {
- GameMain.Instance.SoundMgr.PlaySe("SE005.ogg", false);
- CameraMain mainCamera = GameMain.Instance.MainCamera;
- mainCamera.SetControl(false);
- Maid maid = GameMain.Instance.CharacterMgr.GetMaid(0);
- Transform bone = maid.body0.GetBone("Bip01 Head");
- Vector3 position = bone.position;
- Vector3 vector = new Vector3(0.03583635f, 0.3097733f, -0.4142513f);
- Vector2 vector2 = new Vector2(-18.80226f, 11.24228f);
- mainCamera.SetTargetPos(vector, true);
- mainCamera.SetAroundAngle(vector2, true);
- mainCamera.SetDistance(0.7f, true);
- Vector3 f_vCenter = new Vector3(position.x - 0.0343059041f, position.y - 0.3253325f, position.z - 0.48361522f);
- Vector2 f_vRotate = new Vector2(-182.2753f, 11.24231f);
- float f_fRadius = 2.8f;
- float num = 5.5f;
- mainCamera.StartAnimationTo(true, vector, 0.7f, vector2, f_vCenter, f_fRadius, f_vRotate, num, "easeOutCubic", false, 0.5f);
- this.wait_time = Time.time + num + 1f;
- this.phase_status_ = CompetitiveShowMgr.PhaseStatus.CameraAction;
- }
- protected virtual void Update()
- {
- if (this.phase_status_ == CompetitiveShowMgr.PhaseStatus.CameraAction && this.wait_time < Time.time)
- {
- Maid maid = GameMain.Instance.CharacterMgr.GetMaid(0);
- if (this.is_success)
- {
- if (UnityEngine.Random.Range(0, 1) == 0)
- {
- maid.FaceAnime("にっこり", 0f, 0);
- }
- else
- {
- maid.FaceAnime("笑顔", 0f, 0);
- }
- maid.FaceBlend("頬1涙0");
- GameMain.Instance.SoundMgr.PlaySe("SE007.ogg", false);
- GameMain.Instance.SoundMgr.PlaySe("SE008.ogg", false);
- if (CompetitiveShowMgr.compatibilityMode)
- {
- GameMain.Instance.SoundMgr.PlayBGMLegacy("BGM021.ogg", 0f, true);
- }
- else
- {
- GameMain.Instance.SoundMgr.PlayBGM("BGM007.ogg", 0f, true);
- }
- GameObject bgObject = GameMain.Instance.BgMgr.BgObject;
- if (bgObject != null)
- {
- GameObject gameObject = Utility.CreatePrefab(bgObject, "Prefab/Particle/PKamihubuki", true);
- Vector3 localPosition = new Vector3(-1.08f, 4.06f, 0.2f);
- gameObject.transform.localPosition = localPosition;
- ParticleSystem[] componentsInChildren = gameObject.GetComponentsInChildren<ParticleSystem>();
- foreach (ParticleSystem particleSystem in componentsInChildren)
- {
- particleSystem.shape.angle = 25f;
- }
- }
- KeyValuePair<string, string> competitiveMotionFileVictory = maid.status.personal.competitiveMotionFileVictory;
- this.ClassEffect.SetActive(true);
- GameMain.Instance.ScriptMgr.LoadMotionScript(0, false, competitiveMotionFileVictory.Key, competitiveMotionFileVictory.Value, string.Empty, string.Empty, false, true, false);
- }
- else
- {
- if (UnityEngine.Random.Range(0, 1) == 0)
- {
- maid.FaceAnime("泣き", 0f, 0);
- }
- else
- {
- maid.FaceAnime("困った", 0f, 0);
- }
- KeyValuePair<string, string> competitiveMotionFileDefeat = maid.status.personal.competitiveMotionFileDefeat;
- GameMain.Instance.SoundMgr.PlaySe("SE021.ogg", false);
- GameMain.Instance.ScriptMgr.LoadMotionScript(0, false, competitiveMotionFileDefeat.Key, competitiveMotionFileDefeat.Value, string.Empty, string.Empty, false, true, false);
- }
- this.wait_time = Time.time + 3f;
- this.phase_status_ = CompetitiveShowMgr.PhaseStatus.MotionPlay;
- }
- else if (this.phase_status_ == CompetitiveShowMgr.PhaseStatus.MotionPlay && this.wait_time < Time.time)
- {
- this.sceneMgr.GetManager<MaidExaminationMgr>().BaseOpenPanel();
- this.phase_status_ = CompetitiveShowMgr.PhaseStatus.ResultDraw;
- }
- }
- public GameObject ClassEffect;
- public static List<Maid> check_maid_list = new List<Maid>();
- public static bool is_effect_ones = true;
- private bool is_success;
- private CompetitiveShowMgr.PhaseStatus phase_status_;
- private float wait_time;
- private enum PhaseStatus
- {
- Null,
- CameraAction,
- MotionPlay,
- ResultDraw
- }
- }
|