Exemplo n.º 1
0
        protected virtual bool SetupAnimation(T ths, MagicControl control, bool twoPerson)
        {
            if (mWand is MagicHands)
            {
                ths.SetParameter("noWand", true);
            }
            else
            {
                ths.SetParameter("noWand", false);
            }

            ths.SetActor("wand", mWand);
            ths.SetParameter("isSkilled", control.GetSkillLevel(ths.Actor.SimDescription) >= MagicWand.kExpertLevel);

            IMagicalInteraction interaction = ths as IMagicalInteraction;

            if (interaction != null)
            {
                ths.AddOneShotScriptEventHandler(0x65, interaction.ShowSuccessVfx);
                ths.AddOneShotScriptEventHandler(0x66, interaction.ShowFailVfx);
                ths.AddOneShotScriptEventHandler(0x67, interaction.ShowEpicFailVfx);
            }

            return(true);
        }
Exemplo n.º 2
0
            protected override bool PerformResults(CastConvertEx ths, string epicJazzName, IMagicalDefinition definition, MagicControl control, bool spellCastingSucceeded, bool spellCastingEpiclyFailed)
            {
                bool        flag2          = false;
                IGameObject conjuredObject = ths.PreCreateObject();

                if (((conjuredObject is Fish) && !(ths.Target.Parent is ISurface)) || (conjuredObject is FailureObject))
                {
                    conjuredObject.Destroy();
                    conjuredObject = null;
                    flag2          = true;
                }

                if (conjuredObject != null)
                {
                    int num        = kMaxConversionValue[0x1];
                    int skillLevel = control.GetSkillLevel(ths.Actor.SimDescription);
                    if ((skillLevel >= definition.SpellSettings.mMinSkillLevel) && (skillLevel <= 0xa))
                    {
                        num = kMaxConversionValue[skillLevel];
                    }
                    if (conjuredObject.Value > num)
                    {
                        flag2 = true;
                    }
                }

                bool succeeded = false;

                if (!flag2 && spellCastingSucceeded)
                {
                    succeeded = true;
                    ths.AnimateSim("SuccessIdle");
                    ths.AnimateSim("Success");
                    ths.OnSpellSuccess(conjuredObject);
                }
                else
                {
                    succeeded = base.PerformResults(ths, epicJazzName, definition, control, false, spellCastingEpiclyFailed);
                }

                if (!succeeded && (conjuredObject != null))
                {
                    conjuredObject.Destroy();
                    conjuredObject = null;
                }

                return(succeeded);
            }