Esempio n. 1
0
        public override void DoAbilityOnTarget(Pawn target)
        {
            Tracker.UseEnergy(Def.EnergyPerUse);
            CooldownTicker = CooldownTicks;

            if (!Rand.Chance(SuccessChanceOnTarget(target)))
            {
                MoteMaker.ThrowText(target.Position.ToVector3(), target.Map, ResistedKey.Translate(), 1.9f);
                Def.SoundDefFailure.PlayOneShot(new TargetInfo(User.Position, User.Map));
                TryThrowFailMoteOnUser();
                return;
            }

            TryThrowMoteOnTarget(target);
            TryThrowMoteSuccessPointerToTarget(target);
            Def.SoundDefSuccessOnCaster?.PlayOneShot(new TargetInfo(User.Position, User.Map));
            Def.SoundDefSuccessOnTarget?.PlayOneShot(new TargetInfo(target.Position, target.Map));

            var statTransfer =
                Mathf.Min(Def.BaseSkillTransfer * Tracker.GetTotalModifierActive() * target.PsiTracker().GetTotalModifierActive(), 1);

            active = PsiTechSkillTransferUtility.TryAddNewTransferPair(new TransferPair
            {
                Initiator = User, Receiver = target, SkillTransferAmount = statTransfer
            });
            if (active)
            {
                linkedPawn = target;
            }
        }
Esempio n. 2
0
        private void EndAbility()
        {
            if (!active)
            {
                return;
            }

            active = false;
            PsiTechSkillTransferUtility.RemoveTransferPairWithInitiator(User);
            linkedPawn = null;
            drawTimer  = 0;
        }