Exemplo n.º 1
0
        public void Effect()
        {
            CasterPawn.Drawer.Notify_DebugAffected();
            if (TargetsAoE.FirstOrDefault(x => x is LocalTargetInfo y && y.Cell != default(IntVec3)) is LocalTargetInfo t)
            {
                var destination = t.Cell;

                MoteMaker.ThrowText(CasterPawn.DrawPos, CasterPawn.Map, AbilityUser.StringsToTranslate.AU_CastSuccess);
                if (destination.IsValid)
                {
                    CasterPawn.Position = destination;
                    CasterPawn.stances.stunner.StunFor(new IntRange(5, 10).RandomInRange, CasterPawn, addBattleLog: false);
                    CasterPawn.Notify_Teleported();

                    //Cheap solution...
                    this.Ability.CooldownTicksLeft = this.Ability.MaxCastingTicks;
                    CasterPawn.BloodNeed().AdjustBlood(-3);
                    return;
                }
                MoteMaker.ThrowText(CasterPawn.DrawPos, CasterPawn.Map, AbilityUser.StringsToTranslate.AU_CastFailure);
            }
        }
        public virtual void Effect()
        {
            CasterPawn.Drawer.Notify_DebugAffected();
            MoteMaker.ThrowText(CasterPawn.DrawPos, CasterPawn.Map, AbilityUser.StringsToTranslate.AU_CastSuccess);
            int num = GenRadial.NumCellsInRadius(3.9f);

            for (int i = 0; i < num; i++)
            {
                IntVec3 curCell = CasterPawn.PositionHeld + GenRadial.RadialPattern[i];
                if (curCell.GetThingList(CasterPawn.MapHeld) is List <Thing> things && !things.NullOrEmpty())
                {
                    List <Thing> temp = new List <Thing>(things);
                    foreach (Thing t in temp)
                    {
                        if (t.def.defName == "FilthBlood")
                        {
                            CasterPawn.BloodNeed().AdjustBlood(1);
                            t.Destroy();
                        }
                    }
                }
            }
        }