Пример #1
0
        /// <summary>
        /// Forces a facial expression on the girl.
        /// </summary>
        /// <param name="girl">The <see cref="Girl"/> instance on which to set the expression on.</param>
        /// <param name="expressionType">The type of expression to set.</param>
        /// <param name="changeEyes">When <c>true</c>, also set the girl's eyes to the one that belongs to the specified expression.</param>
        /// <param name="changeMouth">When <c>true</c>, also set the girl's mouth to the one that belongs to the specified expression.</param>
        /// <remarks>
        /// The girl's eyebrows and face/blush are always set.
        /// When the specified expression is not found, the girl's <see cref="GirlDefinition.defaultExpression"/> will be used.
        /// </remarks>
        public static void ForceExpression(this Girl girl, GirlExpressionType expressionType, bool changeEyes = true, bool changeMouth = true)
        {
            if (girl.definition == null)
            {
                throw new InvalidOperationException($"{nameof(girl)}.{nameof(girl.definition)} is null");
            }

            int index = girl.definition.pieces.FindIndex(p => p.type == GirlPieceType.EXPRESSION && p.expressionType == expressionType);

            if (index == -1)
            {
                index = girl.definition.defaultExpression;
            }

            girl.ForceExpression(index, changeEyes, changeMouth);
        }
Пример #2
0
 public CutsceneStepInfo(CutsceneStepType stepType,
                         CutsceneStepProceedType proceedType,
                         CutsceneStepDollTargetType dollTargetType,
                         GirlExpressionType expressionType,
                         DollOrientationType targetDollOrientation,
                         DollPositionType dollPositionType,
                         CutsceneStepAnimationType animationType,
                         CutsceneStepSubCutsceneType subCutsceneType,
                         GirlPairRelationshipType girlPairRelationshipType,
                         CutsceneStepNotificationType notificationType,
                         string specialStepPrefabName,
                         string bannerTextPrefabName,
                         string windowPrefabName,
                         string emitterBehaviorName,
                         string stringValue,
                         float floatValue,
                         float proceedFloat,
                         int targetGirlDefinitionID,
                         int girlDefinitionID,
                         int expressionIndex,
                         int hairstyleIndex,
                         int outfitIndex,
                         int intValue,
                         int easeType,
                         int editorSelectedBranchIndex,
                         int dialogTriggerDefinitionID,
                         int editorSelectedOptionIndex,
                         int subCutsceneDefinitionID,
                         bool skipStep,
                         bool targetAlt,
                         bool boolValue,
                         bool setMood,
                         bool proceedBool,
                         LogicActionInfo logicActionInfo,
                         DialogLineInfo dialogLineInfo,
                         AudioKlipInfo audioKlipInfo,
                         VectorInfo positionInfo,
                         List <CutsceneDialogOptionInfo> dialogOptionInfos,
                         List <CutsceneBranchInfo> branchInfos)
 {
     SkipStep                  = skipStep;
     StepType                  = stepType;
     ProceedType               = proceedType;
     DollTargetType            = dollTargetType;
     TargetGirlDefinitionID    = targetGirlDefinitionID;
     TargetDollOrientation     = targetDollOrientation;
     TargetAlt                 = targetAlt;
     BoolValue                 = boolValue;
     IntValue                  = intValue;
     FloatValue                = floatValue;
     StringValue               = stringValue;
     EaseType                  = easeType;
     EditorSelectedBranchIndex = editorSelectedBranchIndex;
     BranchInfos               = branchInfos;
     LogicActionInfo           = logicActionInfo;
     SpecialStepPrefabName     = specialStepPrefabName;
     ExpressionType            = expressionType;
     SetMood                   = setMood;
     DialogLineInfo            = dialogLineInfo;
     DialogTriggerDefinitionID = dialogTriggerDefinitionID;
     EditorSelectedOptionIndex = editorSelectedOptionIndex;
     DialogOptionInfos         = dialogOptionInfos;
     DollPositionType          = dollPositionType;
     GirlDefinitionID          = girlDefinitionID;
     ExpressionIndex           = expressionIndex;
     HairstyleIndex            = hairstyleIndex;
     OutfitIndex               = outfitIndex;
     BannerTextPrefabName      = bannerTextPrefabName;
     AnimationType             = animationType;
     SubCutsceneType           = subCutsceneType;
     SubCutsceneDefinitionID   = subCutsceneDefinitionID;
     GirlPairRelationshipType  = girlPairRelationshipType;
     WindowPrefabName          = windowPrefabName;
     AudioKlipInfo             = audioKlipInfo;
     EmitterBehaviorName       = emitterBehaviorName;
     PositionInfo              = positionInfo;
     NotificationType          = notificationType;
     ProceedBool               = proceedBool;
     ProceedFloat              = proceedFloat;
 }
Пример #3
0
 /// <summary>
 /// Gets the girl piece for the specified <see cref="GirlExpressionType"/> for this girl.
 /// </summary>
 /// <param name="girl">The <see cref="Girl"/> instance for which to get the piece.</param>
 /// <param name="expression">The expression type for which to get the <see cref="GirlPiece"/> for.</param>
 /// <returns>The girl piece meant for the specified expression.</returns>
 public static GirlPiece GetGirlPieceByExpressionType(this Girl girl, GirlExpressionType expression)
 {
     return((GirlPiece)AccessTools.Method(typeof(Girl), nameof(GetGirlPieceByExpressionType)).Invoke(girl, new object[] { expression }));
 }
Пример #4
0
        public CutsceneStepInfo(CutsceneStepSubDefinition cutsceneStep, AssetProvider assetProvider)
        {
            if (cutsceneStep == null)
            {
                throw new ArgumentNullException(nameof(cutsceneStep));
            }
            if (assetProvider == null)
            {
                throw new ArgumentNullException(nameof(assetProvider));
            }

            SkipStep                  = cutsceneStep.skipStep;
            StepType                  = cutsceneStep.stepType;
            ProceedType               = cutsceneStep.proceedType;
            DollTargetType            = cutsceneStep.dollTargetType;
            TargetDollOrientation     = cutsceneStep.targetDollOrientation;
            TargetAlt                 = cutsceneStep.targetAlt;
            BoolValue                 = cutsceneStep.boolValue;
            IntValue                  = cutsceneStep.intValue;
            FloatValue                = cutsceneStep.floatValue;
            StringValue               = cutsceneStep.stringValue;
            EaseType                  = (int)cutsceneStep.easeType;
            EditorSelectedBranchIndex = cutsceneStep.editorSelectedBranchIndex;
            ExpressionType            = cutsceneStep.expressionType;
            SetMood = cutsceneStep.setMood;
            EditorSelectedOptionIndex = cutsceneStep.editorSelectedOptionIndex;
            DollPositionType          = cutsceneStep.dollPositionType;
            ExpressionIndex           = cutsceneStep.expressionIndex;
            HairstyleIndex            = cutsceneStep.hairstyleIndex;
            OutfitIndex              = cutsceneStep.outfitIndex;
            AnimationType            = cutsceneStep.animationType;
            SubCutsceneType          = cutsceneStep.subCutsceneType;
            GirlPairRelationshipType = cutsceneStep.girlPairRelationshipType;
            NotificationType         = cutsceneStep.notificationType;
            ProceedBool              = cutsceneStep.proceedBool;
            ProceedFloat             = cutsceneStep.proceedFloat;

            SubCutsceneDefinitionID   = cutsceneStep.subCutsceneDefinition?.id ?? -1;
            DialogTriggerDefinitionID = cutsceneStep.dialogTriggerDefinition?.id ?? -1;
            GirlDefinitionID          = cutsceneStep.girlDefinition?.id ?? -1;
            TargetGirlDefinitionID    = cutsceneStep.targetGirlDefinition?.id ?? -1;

            assetProvider.NameAndAddAsset(ref SpecialStepPrefabName, cutsceneStep.specialStepPrefab);
            assetProvider.NameAndAddAsset(ref WindowPrefabName, cutsceneStep.windowPrefab);
            assetProvider.NameAndAddAsset(ref EmitterBehaviorName, cutsceneStep.emitterBehavior);
            assetProvider.NameAndAddAsset(ref BannerTextPrefabName, cutsceneStep.bannerTextPrefab);

            if (cutsceneStep.audioKlip != null)
            {
                AudioKlipInfo = new AudioKlipInfo(cutsceneStep.audioKlip, assetProvider);
            }
            if (cutsceneStep.position != null)
            {
                PositionInfo = new VectorInfo(cutsceneStep.position);
            }
            if (cutsceneStep.dialogLine != null)
            {
                DialogLineInfo = new DialogLineInfo(cutsceneStep.dialogLine, assetProvider);
            }
            if (cutsceneStep.logicAction != null)
            {
                LogicActionInfo = new LogicActionInfo(cutsceneStep.logicAction, assetProvider);
            }

            if (cutsceneStep.dialogOptions != null)
            {
                DialogOptionInfos = cutsceneStep.dialogOptions.Select(x => new CutsceneDialogOptionInfo(x, assetProvider)).ToList();
            }
            if (cutsceneStep.branches != null)
            {
                BranchInfos = cutsceneStep.branches.Select(x => new CutsceneBranchInfo(x, assetProvider)).ToList();
            }
        }