コード例 #1
0
        public void h_with(
            Actor partner,
            int hType              = 0,
            int hPosition          = 0,
            int hStage             = 0,
            List <Actor> extActors = null)
        {
            Actor      factor;
            Actor      mactor;
            List <int> validCategoryKey;
            List <int> validNoKey;

            // partner: another actor as sex partner
            // hType: 0-serve, 1-insert, 2-yuri
            // hPosition:
            // hStage:
            // extActors: always (), no multi h in koikatu now
            // sync with partner
            if (this.Position != partner.Position || this.Rotation != partner.Rotation || this.Scale != partner.Scale)
            {
                partner.move(pos: this.Position, rot: this.Rotation, scale: this.Scale);
            }
            if (this.AnimeSpeed != partner.AnimeSpeed)
            {
                partner.AnimeSpeed = this.AnimeSpeed;
            }
            if (this.AnimePattern != partner.AnimePattern)
            {
                partner.AnimePattern = this.AnimePattern;
            }
            if (this.AnimationForceLoop != partner.AnimationForceLoop)
            {
                partner.AnimationForceLoop = this.AnimationForceLoop;
            }
            // decide sex role
            if (this.Sex == 0)
            {
                mactor = this;
                factor = partner;
            }
            else
            {
                mactor = partner;
                factor = this;
            }
            // show son for male
            var mss = mactor.Son;

            if (!mss.visible && mactor.Sex == 0)
            {
                mactor.Son = new Son_s {
                    visible = true, length = mss.length
                };
            }
            // load anime
            var info  = Info.Instance;
            var gcDic = info.dicAGroupCategory;
            var aDic  = info.dicAnimeLoadInfo;

            if (hType == 0)
            {
                // serve
                validCategoryKey = gcDic[3].dicCategory.Keys.ToList();
                if (!Enumerable.Range(0, validCategoryKey.Count).Contains(hPosition))
                {
                    Console.WriteLine(String.Format("invalid hPosition %d, must be 0~%d", hPosition, validCategoryKey.Count - 1));
                    return;
                }
                validNoKey = aDic[3][validCategoryKey[hPosition]].Keys.ToList();
                if (!Enumerable.Range(0, validNoKey.Count).Contains(hStage))
                {
                    Console.WriteLine(String.Format("invalid hStage %d, must be 0~%d", hStage, validNoKey.Count - 1));
                    return;
                }
                //print "a.animate(3, %d, %d)"%(validCategoryKey[hPosition], validNoKey[hStage])
                //print "b.animate(2, %d, %d)"%(validCategoryKey[hPosition], validNoKey[hStage])
                mactor.SetAnimate(3, validCategoryKey[hPosition], validNoKey[hStage]);
                factor.SetAnimate(2, validCategoryKey[hPosition], validNoKey[hStage]);
            }
            else if (hType == 1)
            {
                // insert
                validCategoryKey = gcDic[5].dicCategory.Keys.ToList();
                if (!Enumerable.Range(0, validCategoryKey.Count).Contains(hPosition))
                {
                    Console.WriteLine(String.Format("invalid hPosition %d, must be 0~%d", hPosition, validCategoryKey.Count - 1));
                    return;
                }
                validNoKey = aDic[5][validCategoryKey[hPosition]].Keys.ToList();
                if (!Enumerable.Range(0, validNoKey.Count).Contains(hStage))
                {
                    Console.WriteLine(String.Format("invalid hStage %d, must be 0~%d", hStage, validNoKey.Count - 1));
                    return;
                }
                //print "a.animate(5, %d, %d)"%(validCategoryKey[hPosition], validNoKey[hStage])
                //print "b.animate(4, %d, %d)"%(validCategoryKey[hPosition], validNoKey[hStage])
                mactor.SetAnimate(5, validCategoryKey[hPosition], validNoKey[hStage]);
                factor.SetAnimate(4, validCategoryKey[hPosition], validNoKey[hStage]);
            }
            else
            {
                // yuri
                validCategoryKey = new List <int> {
                    179,
                    181,
                    183
                };
                if (!Enumerable.Range(0, validCategoryKey.Count).Contains(hPosition))
                {
                    Console.WriteLine(String.Format("invalid hPosition %d, must be 0~%d", hPosition, validCategoryKey.Count - 1));
                    return;
                }
                validNoKey = aDic[9][validCategoryKey[hPosition]].Keys.ToList();
                if (!Enumerable.Range(0, validNoKey.Count).Contains(hStage))
                {
                    Console.WriteLine(String.Format("invalid hStage %d, must be 0~%d", hStage, validNoKey.Count - 1));
                    return;
                }
                //print "a.animate(9, %d, %d)"%(validCategoryKey[hPosition], validNoKey[hStage])
                //print "b.animate(9, %d, %d)"%(validCategoryKey[hPosition]+1, validNoKey[hStage])
                mactor.SetAnimate(9, validCategoryKey[hPosition], validNoKey[hStage]);
                factor.SetAnimate(9, validCategoryKey[hPosition] + 1, validNoKey[hStage]);
            }
            // auto adjust anime param
            Console.WriteLine(String.Format("factor({0}): height={1} breast={2}", factor.text_name, factor.Height, factor.Breast));
            var anime_option_param = new AnimeOption_s {
                height = factor.Height, breast = factor.Breast
            };

            if (factor.IsHAnime)
            {
                factor.AnimationOption = anime_option_param;
            }
            if (mactor.IsHAnime)
            {
                mactor.AnimationOption = anime_option_param;
            }
            foreach (var extActor in extActors)
            {
                if (extActor != null && extActor.IsHAnime)
                {
                    extActor.AnimationOption = anime_option_param;
                }
            }
        }
コード例 #2
0
ファイル: Actor.cs プロジェクト: hallongrotta/VNEngine-Sharp
        public void h_with(
            Actor partner,
            int hType              = 0,
            int hPosition          = 0,
            int hStage             = 0,
            List <Actor> extActors = null)
        {
            Actor      factor;
            Actor      mactor;
            List <int> validCategoryKey;
            List <int> validNoKey;

            // partner: another actor as sex partner
            // hType: 0-touth, 1-serve, 2-insert, 3-special, 4-yuri
            // hPosition:
            // hStage:
            // extActors:
            // sync with partner
            if (this.pos != partner.pos || this.rot != partner.rot || this.scale != partner.scale)
            {
                partner.move(pos: this.pos, rot: this.rot, scale: this.scale);
            }
            if (this.animeSpeed != partner.animeSpeed)
            {
                partner.animeSpeed = this.animeSpeed;
            }
            if (this.animePattern != partner.animePattern)
            {
                partner.animePattern = this.animePattern;
            }
            if (this.anime_forceloop != partner.anime_forceloop)
            {
                partner.anime_forceloop = this.anime_forceloop;
            }
            // decide sex role
            if (this.sex == 0)
            {
                mactor = this;
                factor = partner;
            }
            else
            {
                mactor = partner;
                factor = this;
            }
            // show son for male
            var mss = mactor.son;

            if (!mss.visible && mactor.sex == 0)
            {
                mactor.son = new Son_s {
                    visible = true, length = mss.length
                };
            }
            // load anime
            var info  = Info.Instance;
            var gcDic = info.dicAGroupCategory;
            var aDic  = info.dicAnimeLoadInfo;

            if (hType == 0)
            {
                // touch
                validCategoryKey = gcDic[1].dicCategory.Keys.ToList();
                if (!Enumerable.Range(0, validCategoryKey.Count).Contains(hPosition))
                {
                    Console.WriteLine(String.Format("invalid hPosition %d, must be 0~%d", hPosition, validCategoryKey.Count - 1));
                    return;
                }
                validNoKey = aDic[1][validCategoryKey[hPosition]].Keys.ToList();
                if (!Enumerable.Range(0, validNoKey.Count).Contains(hStage))
                {
                    Console.WriteLine(String.Format("invalid hStage %d, must be 0~%d", hStage, validNoKey.Count - 1));
                    return;
                }
                Console.WriteLine(String.Format("%s anime(%d, %d, %d)", mactor.text_name, 2, validCategoryKey[hPosition], validNoKey[hStage]));
                Console.WriteLine(String.Format("%s anime(%d, %d, %d)", factor.text_name, 1, validCategoryKey[hPosition], validNoKey[hStage]));
                mactor.setAnimate(2, validCategoryKey[hPosition], validNoKey[hStage]);
                factor.setAnimate(1, validCategoryKey[hPosition], validNoKey[hStage]);
            }
            else if (hType == 1)
            {
                // serve
                validCategoryKey = gcDic[3].dicCategory.Keys.ToList();
                if (!Enumerable.Range(0, validCategoryKey.Count).Contains(hPosition))
                {
                    Console.WriteLine(String.Format("invalid hPosition %d, must be 0~%d", hPosition, validCategoryKey.Count - 1));
                    return;
                }
                validNoKey = aDic[3][validCategoryKey[hPosition]].Keys.ToList();
                if (!Enumerable.Range(0, validNoKey.Count).Contains(hStage))
                {
                    Console.WriteLine(String.Format("invalid hStage %d, must be 0~%d", hStage, validNoKey.Count - 1));
                    return;
                }
                mactor.setAnimate(4, validCategoryKey[hPosition], validNoKey[hStage]);
                factor.setAnimate(3, validCategoryKey[hPosition], validNoKey[hStage]);
            }
            else if (hType == 2)
            {
                // insert
                validCategoryKey = gcDic[5].dicCategory.Keys.ToList();
                if (!Enumerable.Range(0, validCategoryKey.Count).Contains(hPosition))
                {
                    Console.WriteLine(String.Format("invalid hPosition %d, must be 0~%d", hPosition, validCategoryKey.Count - 1));
                    return;
                }
                validNoKey = aDic[5][validCategoryKey[hPosition]].Keys.ToList();
                if (!Enumerable.Range(0, validNoKey.Count).Contains(hStage))
                {
                    Console.WriteLine(String.Format("invalid hStage %d, must be 0~%d", hStage, validNoKey.Count - 1));
                    return;
                }
                mactor.setAnimate(6, validCategoryKey[hPosition], validNoKey[hStage]);
                factor.setAnimate(5, validCategoryKey[hPosition], validNoKey[hStage]);
            }
            else if (hType == 3)
            {
                // insert
                validCategoryKey = gcDic[7].dicCategory.Keys.ToList();
                if (!Enumerable.Range(0, validCategoryKey.Count).Contains(hPosition))
                {
                    Console.WriteLine(String.Format("invalid hPosition %d, must be 0~%d", hPosition, validCategoryKey.Count - 1));
                    return;
                }
                validNoKey = aDic[7][validCategoryKey[hPosition]].Keys.ToList();
                if (!Enumerable.Range(0, validNoKey.Count).Contains(hStage))
                {
                    Console.WriteLine(String.Format("invalid hStage %d, must be 0~%d", hStage, validNoKey.Count - 1));
                    return;
                }
                mactor.setAnimate(8, validCategoryKey[hPosition], validNoKey[hStage]);
                factor.setAnimate(7, validCategoryKey[hPosition], validNoKey[hStage]);
            }
            else
            {
                // yuri
                validCategoryKey = new List <int> {
                    215,
                    217,
                    219,
                    221,
                    223
                };
                if (!Enumerable.Range(0, validCategoryKey.Count).Contains(hPosition))
                {
                    Console.WriteLine(String.Format("invalid hPosition %d, must be 0~%d", hPosition, validCategoryKey.Count - 1));
                    return;
                }
                validNoKey = aDic[9][validCategoryKey[hPosition]].Keys.ToList();
                if (!Enumerable.Range(0, validNoKey.Count).Contains(hStage))
                {
                    Console.WriteLine(String.Format("invalid hStage %d, must be 0~%d", hStage, validNoKey.Count - 1));
                    return;
                }
                mactor.setAnimate(9, validCategoryKey[hPosition], validNoKey[hStage]);
                factor.setAnimate(9, validCategoryKey[hPosition] + 1, validNoKey[hStage]);
            }
            // auto adjust anime param
            Console.WriteLine(String.Format("factor(%s): height=%.2f breast=%.2f", factor.text_name, factor.height, factor.breast));
            var anime_option_param = new AnimeOption_s {
                height = factor.height, breast = factor.breast
            };

            if (factor.isHAnime)
            {
                factor.anime_option_param = anime_option_param;
            }
            if (mactor.isHAnime)
            {
                mactor.anime_option_param = anime_option_param;
            }
            foreach (var extActor in extActors)
            {
                if (extActor != null && extActor.isHAnime)
                {
                    extActor.anime_option_param = anime_option_param;
                }
            }
        }
コード例 #3
0
        public NEOActorData(Actor a)
        {
            visible = a.Visible;
            if (visible)
            {
                position     = a.Position;
                rotation     = a.Rotation;
                scale        = a.Scale;
                animeSpeed   = a.AnimeSpeed;
                animePattern = a.AnimePattern;

                forceLoop = a.AnimationForceLoop;

                accessoryStatus = a.Accessories;

                faceRedness = a.FaceRedness;
                son         = a.Son;

                anim = a.Animation;

                animeOption = new AnimeOption_s {
                    height = a.Height, breast = a.Breast
                };

                cloth = a.Clothes;

                juice          = a.Juice;
                nippleHardness = a.NippleStand;

                simple      = a.Simple;
                simpleColor = a.SimpleColor;

                eyeLookPattern = a.Gaze;
                eyeLookPos     = a.GazeTarget;
                neckPattern    = a.LookNeckPattern;

                neck           = a.LookNeckFull2;
                eyebrowPattern = a.EyebrowPattern;
                eyePattern     = a.EyePattern;
                eyesOpen       = a.EyesOpenLevel;
                eyeAngles      = a.EyeAngles;
                blinking       = a.EyesBlink;
                mouthPattern   = a.MouthPattern;
                mouthOpen      = a.MouthOpenLevel;
                lipSync        = a.LipSync;
                handMotions    = a.HandPattern;
                kinematicType  = a.Kinematic;
                fkActive       = a.get_FK_active();
                ikActive       = a.get_IK_active();

                if (kinematicType == KinematicMode.FK || kinematicType == KinematicMode.IKFK)
                {
                    fk = a.export_fk_bone_info();
                }
                if (kinematicType == KinematicMode.IK || kinematicType == KinematicMode.IKFK)
                {
                    ik = a.export_ik_target_info();
                }

                voiceList   = a.VoiceList;
                voiceRepeat = a.VoiceRepeat;

                // External plugin data
                try
                {
                    if (kinematicType == KinematicMode.IK)
                    {
                        advIKData = new AdvIKData(a);
                    }
                }
                catch (Exception e)
                {
                    Console.WriteLine(e);
                }
            }
        }