Ejemplo n.º 1
0
            // Overrides
            public override void OnActivate()
            {
                // Cache
                float differenceY = m_item.transform.position.y - LastCharacter.transform.position.y;
                bool  isStanding  = differenceY >= STANDING_TAKE_MIN_HEIGHT;

                Character.SpellCastType animation = isStanding ? Character.SpellCastType.UseUp : Character.SpellCastType.PickupGround;

                // Execute
                if (!LastCharacter.Sheathed)
                {
                    LastCharacter.SheatheInput();
                }
                this.ExecuteOnceWhen(() => !LastCharacter.Sheathing, () =>
                {
                    // Sending SpellCast message to null to override default behaviour
                    // (will raise a few log messages, but no errors)
                    LastCharacter.CastSpell(animation, (GameObject)null, Character.SpellCastModifier.Immobilized, 1, -1f);
                    this.ExecuteOnceAfterDelay(ANIMATED_TAKE_DELAY, () =>
                    {
                        m_item.SetBeingTaken(true, RightHandTransform);
                        this.ExecuteOnceWhen(() => LastCharacter.CurrentSpellCast == Character.SpellCastType.NONE, () =>
                        {
                            TryTake(m_item, false);
                            base.OnActivate();
                        });
                    });
                });
            }
Ejemplo n.º 2
0
        public override void SerializeEffect <T>(T effect)
        {
            var comp = effect as PlayAnimationEffect;

            this.Animation       = comp.Animation;
            this.Modifier        = comp.Modifier;
            this.SheatheRequired = comp.SheatheRequired;
        }
Ejemplo n.º 3
0
 public static void Prefix(Character __instance, ref Character.SpellCastType _type, ref Character.SpellCastModifier _modifier, Animator ___m_animator, int _sheatheRequired = 1)
 {
 }