コード例 #1
0
        static void PostfixSetBool(Pathea.ActorNs.Actor __instance, string str, bool val)
        {
            if (!AnimHelper.IsPlayer(__instance))
            {
                return;
            }

            // Main.dump("Pathea.ActorNs.Actor::SetBool "+__instance.name+" " + str);

            if (!val)
            {
                AnimHelper.clearPlayerAnimSpeed();
                // release player from lingering anims.
                Pathea.MessageSystem.MessageManager.Instance.Dispatch("InteractAnimEnd");
                return;
            }

            AnimHelper.SetPlayerAnimSpeed(AnimHelper.GetSpeedForAnimName(str));
        }
コード例 #2
0
        static void PrefixRunSkill(ref Pathea.SkillNs.SkillRunner __instance, ref Pathea.SkillNs.Skill skill, ref Pathea.SkillNs.Caster caster, ref Pathea.SkillNs.Target receiver)
        {
            if (!System.Object.ReferenceEquals(caster.Castable, Pathea.Player.Self.actor))
            {
                return;
            }


            float  animSpeed         = -1.0F;
            string detectedAnimation = "";

            skill.ForEachCmd(delegate(Pathea.SkillNs.Cmd cmd)
            {
                if (animSpeed > 0.0F)
                {
                    return;
                }

                if (cmd is Pathea.SkillNs.AnimationCmd)
                {
                    // stop at first animation cmd.
                    detectedAnimation = (string)Traverse.Create(cmd).Field("mAnimation").GetValue();
                    animSpeed         = AnimHelper.GetSpeedForAnimName(detectedAnimation);
                }
            });

            // Main.dump(detectedAnimation);
            // Main.dump(animSpeed);

            if (animSpeed < 0.0F)
            {
                animSpeed = Main.modSettings.GlobalPlayerAnimSpeed;
            }
            // Main.dump(detectedAnimation);
            // Main.dump(animSpeed);

            Traverse.Create(skill).Field("totaltime").SetValue(skill.TotalTime / animSpeed);
            Traverse.Create(skill).Field("nextSkillTime").SetValue(skill.NextSkillTime / animSpeed);
            Traverse.Create(skill).Field("cdTime").SetValue(skill.CdTime / animSpeed);
        }