Beispiel #1
0
 public void TargeterUpdate()
 {
     if (targetingVerb != null)
     {
         targetingVerb.verbProps.DrawRadiusRing(targetingVerb.caster.Position);
         LocalTargetInfo targ = CurrentTargetUnderMouse(mustBeHittableNowIfNotMelee: true);
         if (targ.IsValid)
         {
             GenDraw.DrawTargetHighlight(targ);
             bool  needLOSToCenter;
             float num = targetingVerb.HighlightFieldRadiusAroundTarget(out needLOSToCenter);
             if (num > 0.2f && targetingVerb.TryFindShootLineFromTo(targetingVerb.caster.Position, targ, out ShootLine resultingLine))
             {
                 if (needLOSToCenter)
                 {
                     GenExplosion.RenderPredictedAreaOfEffect(resultingLine.Dest, num);
                 }
                 else
                 {
                     GenDraw.DrawFieldEdges((from x in GenRadial.RadialCellsAround(resultingLine.Dest, num, useCenter: true)
                                             where x.InBounds(Find.CurrentMap)
                                             select x).ToList());
                 }
             }
         }
     }
     if (action != null)
     {
         LocalTargetInfo targ2 = CurrentTargetUnderMouse(mustBeHittableNowIfNotMelee: false);
         if (targ2.IsValid)
         {
             GenDraw.DrawTargetHighlight(targ2);
         }
     }
 }
Beispiel #2
0
        public static void DrawStrikePreview(IntVec3 start, IntVec3 end, Map map, int bombCount, float explosionRadius)
        {
            if (start == end)
            {
                GenExplosion.RenderPredictedAreaOfEffect(start, explosionRadius);
                return;
            }

            int index = 0;

            tempCells.Clear();
            foreach (var cell in GeneratePoints(start, end, bombCount))
            {
                tempCells.Add(cell);

                int t = (int)(Time.unscaledTime * 6f);
                t = t % bombCount;
                bool drawRadius = t == index;
                bool thickRoof  = cell.GetRoof(map)?.isThickRoof ?? false;

                if (explosionRadius > 0 && drawRadius && !thickRoof)
                {
                    GenExplosion.RenderPredictedAreaOfEffect(cell, explosionRadius);
                }

                index++;
            }
            GenDraw.DrawFieldEdges(tempCells, Color.red);
        }
Beispiel #3
0
 public void TargeterUpdate()
 {
     if (this.targetingVerb != null)
     {
         if (!this.targetingVerb.verbProps.MeleeRange)
         {
             if (this.targetingVerb.verbProps.minRange > 0.0 && this.targetingVerb.verbProps.minRange < GenRadial.MaxRadialPatternRadius)
             {
                 GenDraw.DrawRadiusRing(this.targetingVerb.caster.Position, this.targetingVerb.verbProps.minRange);
             }
             float   range = this.targetingVerb.verbProps.range;
             IntVec3 size  = Find.VisibleMap.Size;
             int     x2    = size.x;
             IntVec3 size2 = Find.VisibleMap.Size;
             if (range < (float)(x2 + size2.z) && this.targetingVerb.verbProps.range < GenRadial.MaxRadialPatternRadius)
             {
                 GenDraw.DrawRadiusRing(this.targetingVerb.caster.Position, this.targetingVerb.verbProps.range);
             }
         }
         LocalTargetInfo targ = this.CurrentTargetUnderMouse(true);
         if (targ.IsValid)
         {
             GenDraw.DrawTargetHighlight(targ);
             bool      flag      = default(bool);
             float     num       = this.targetingVerb.HighlightFieldRadiusAroundTarget(out flag);
             ShootLine shootLine = default(ShootLine);
             if (num > 0.20000000298023224 && this.targetingVerb.TryFindShootLineFromTo(this.targetingVerb.caster.Position, targ, out shootLine))
             {
                 if (flag)
                 {
                     GenExplosion.RenderPredictedAreaOfEffect(shootLine.Dest, num);
                 }
                 else
                 {
                     GenDraw.DrawFieldEdges((from x in GenRadial.RadialCellsAround(shootLine.Dest, num, true)
                                             where x.InBounds(Find.VisibleMap)
                                             select x).ToList());
                 }
             }
         }
     }
     if (this.action != null)
     {
         LocalTargetInfo targ2 = this.CurrentTargetUnderMouse(false);
         if (targ2.IsValid)
         {
             GenDraw.DrawTargetHighlight(targ2);
         }
     }
 }
Beispiel #4
0
        // Token: 0x06002189 RID: 8585 RVA: 0x000CB488 File Offset: 0x000C9688
        public override void DrawHighlight(LocalTargetInfo target)
        {
            AbilityDef def = this.ability.def;

            this.DrawRadius();
            if (this.CanHitTarget(target) && this.IsApplicableTo(target, false))
            {
                if (def.HasAreaOfEffect)
                {
                    if (target.IsValid)
                    {
                        GenDraw.DrawTargetHighlight(target);
                        GenDraw.DrawRadiusRing(target.Cell, def.EffectRadius, Verb_CastAbility.RadiusHighlightColor, null);
                    }
                }
                else
                {
                    GenDraw.DrawTargetHighlight(target);
                }
            }
            if (target.IsValid)
            {
                this.ability.DrawEffectPreviews(target);
            }
            this.verbProps.DrawRadiusRing(this.caster.Position);
            if (target.IsValid)
            {
                GenDraw.DrawTargetHighlight(target);
                bool      flag;
                float     num = this.HighlightFieldRadiusAroundTarget(out flag);
                ShootLine shootLine;
                if (num > 0.2f && this.TryFindShootLineFromTo(this.caster.Position, target, out shootLine))
                {
                    if (flag)
                    {
                        GenExplosion.RenderPredictedAreaOfEffect(shootLine.Dest, num);
                        return;
                    }
                    GenDraw.DrawFieldEdges((from x in GenRadial.RadialCellsAround(shootLine.Dest, num, true)
                                            where x.InBounds(Find.CurrentMap)
                                            select x).ToList <IntVec3>());
                }
            }
        }
Beispiel #5
0
 public void TargeterUpdate()
 {
     if (this.targetingVerb != null)
     {
         this.targetingVerb.verbProps.DrawRadiusRing(this.targetingVerb.caster.Position);
         LocalTargetInfo targ = this.CurrentTargetUnderMouse(true);
         if (targ.IsValid)
         {
             GenDraw.DrawTargetHighlight(targ);
             bool  flag;
             float num = this.targetingVerb.HighlightFieldRadiusAroundTarget(out flag);
             if (num > 0.2f)
             {
                 ShootLine shootLine;
                 if (this.targetingVerb.TryFindShootLineFromTo(this.targetingVerb.caster.Position, targ, out shootLine))
                 {
                     if (flag)
                     {
                         GenExplosion.RenderPredictedAreaOfEffect(shootLine.Dest, num);
                     }
                     else
                     {
                         GenDraw.DrawFieldEdges((from x in GenRadial.RadialCellsAround(shootLine.Dest, num, true)
                                                 where x.InBounds(Find.CurrentMap)
                                                 select x).ToList <IntVec3>());
                     }
                 }
             }
         }
     }
     if (this.action != null)
     {
         LocalTargetInfo targ2 = this.CurrentTargetUnderMouse(false);
         if (targ2.IsValid)
         {
             GenDraw.DrawTargetHighlight(targ2);
         }
     }
 }