Exemplo n.º 1
0
        //咖喱技能2
        public static Command_CastSkill Skill2()
        {
            var ck = new Command_CastSkill
            {
                defaultLabel    = "ExcaliburSkill2.name".Translate(),
                icon            = ContentFinder <Texture2D> .Get("Skills/ExcaliburSkill2"),
                targetingParams = WarframeStaticMethods.OnlyPawn(),
                cooldownTime    = 0.2f,
                range           = 18f,
                hotKey          = KeyBindingDefOf.Misc8
            };

            ck.action = delegate(Pawn self)
            {
                SoundDef.Named("Excalibur_RadialBlind").PlayOneShot(self);
                foreach (var iv in WarframeStaticMethods.GetCellsAround(self.Position, self.Map, ck.range))
                {
                    foreach (var t in self.Map.thingGrid.ThingsAt(iv))
                    {
                        if (t is not Pawn pawn)
                        {
                            continue;
                        }

                        if (pawn != self)
                        {
                            if (pawn.Faction != self.Faction)
                            {
                                pawn.stances.stunner.StunFor(
                                    (int)(7f * 60f * (1f + (WarframeStaticMethods.GetWFLevel(self) / 30f))), self);
                            }
                        }
                        else
                        {
                            self.stances.stunner.StunFor(60, self);
                        }
                    }
                }

                {
                    var mote = (Mote)ThingMaker.MakeThing(ThingDef.Named("Mote_ExFlash"));
                    mote.exactPosition = self.Position.ToVector3Shifted();
                    mote.Scale         = Mathf.Max(23, 25) * 6f;
                    mote.rotationRate  = 1.2f;

                    GenSpawn.Spawn(mote, self.Position + new IntVec3(0, 1, 0), self.Map);
                }

                WarframeStaticMethods.StartCooldown(self, ck.cooldownTime, 2,
                                                    WarframeStaticMethods.GetArmor(self).TryGetComp <CompWarframeSkill>().Props.mana2);
            };


            return(ck);
        }
Exemplo n.º 2
0
        public override void Tick()
        {
            base.Tick();
            if (Find.TickManager.TicksGame - 60 < createdTick)
            {
                return;
            }

            float damage = 120 + (8 * WarframeStaticMethods.GetWFLevel(self) / 5);


            foreach (var iv in WarframeStaticMethods.GetCellsAround(self.Position, self.Map, range))
            {
                foreach (var t in self.Map.thingGrid.ThingsAt(iv))
                {
                    if (t is not Pawn pawn)
                    {
                        continue;
                    }

                    if (pawn == self || pawn.Faction == self.Faction)
                    {
                        continue;
                    }

                    WarframeStaticMethods.ShowDamageAmount(pawn, damage.ToString("f0"));
                    // float totaldamage = 0;
                    var dinfo = new DamageInfo(DamageDefOf.Cut, damage, 1, -1, self);

                    /*
                     *          foreach (BodyPartRecord bpr in (t as Pawn).health.hediffSet.GetNotMissingParts(BodyPartHeight.Undefined, BodyPartDepth.Outside))
                     *          {
                     *              (t as Pawn).TakeDamage(dinfo);
                     *              totaldamage += bpr.def.hitPoints;
                     *              dinfo.SetAmount(damage - totaldamage);
                     *              if (totaldamage > damage)
                     *              {
                     *                  break;
                     *              }
                     *          }
                     */
                    pawn.TakeDamage(dinfo);
                    {
                        var mote = (Mote)ThingMaker.MakeThing(ThingDef.Named("Mote_2ExFlash"));
                        mote.exactPosition = pawn.Position.ToVector3Shifted();
                        mote.Scale         = Mathf.Max(10f, 15f);
                        mote.rotationRate  = 1.2f;
                        // mote.Scale = 0.2f;
                        GenSpawn.Spawn(mote, pawn.Position + new IntVec3(0, 1, 0), self.Map);
                    }
                }
            }

            Destroy();
        }
Exemplo n.º 3
0
        public override void Tick()
        {
            ageTicks++;
            if (ageTicks > 600 * (1 + (WarframeStaticMethods.GetWFLevel(self) * 1.0f / 60f)))
            {
                TimeOut();
            }

            DrawHediffExtras();


            //GenDraw.DrawFieldEdges(this.CellsAdjacent8WayAndInsidePlus(this.pawn).ToList());
            foreach (var ic in CellsAdjacent8WayAndInsidePlus(pawn))
            {
                if (ic == pawn.Position)
                {
                    continue;
                }

                foreach (var th in pawn.Map.thingGrid.ThingsAt(ic))
                {
                    if (th is not Projectile projectile)
                    {
                        continue;
                    }

                    if (projectile.def.projectile.flyOverhead)
                    {
                        continue;
                    }

                    //bullets.Add(th as Projectile);

                    var bdef = projectile.def;


                    projectile.Destroy();

                    var projectile2 = (Projectile)GenSpawn.Spawn(bdef, pawn.Position, pawn.Map);

                    var   hitTypes = ProjectileHitFlags.All;
                    Thing gun      = null;
                    if (pawn.equipment is { Primary: { } })
Exemplo n.º 4
0
        //咖喱技能1
        public static Command_CastSkillTargeting Skill1()
        {
            var ck = new Command_CastSkillTargeting
            {
                defaultLabel    = "MagSkill1.name".Translate(),
                icon            = ContentFinder <Texture2D> .Get("Skills/MagSkill1"),
                targetingParams = WarframeStaticMethods.OnlyPawn(),
                cooldownTime    = 0.2f,
                range           = 20f
            };

            ck.finishAction = delegate
            {
                GenDraw.DrawFieldEdges(
                    WarframeStaticMethods.GetCellsAround(ck.self.Position, ck.self.Map, ck.range));
            };
            ck.hotKey = KeyBindingDefOf.Misc5;
            ck.action = delegate(Pawn self, Thing target)
            {
                // GenExplosion.DoExplosion(self.Position, self.Map, 3.5f, DamageDefOf.Bomb, self, -1, -1, null, null, null, null, null, 0, 1, false, null, 0, 1, 0, false);
                if (!WarframeStaticMethods.GetCellsAround(self.Position, self.Map, ck.range).Contains(target.Position))
                {
                    SoundDefOf.ClickReject.PlayOneShotOnCamera();
                    return;
                }

                var linec = WarframeStaticMethods.GetLineCell(self, target);
                if (linec == null)
                {
                    Messages.Message("BeBlockedByBuilding".Translate(), MessageTypeDefOf.RejectInput, false);
                    return;
                }

                if (!(target is Pawn pawn))
                {
                    return;
                }


                var eway     = self.CellsAdjacent8WayAndInside().ToList();
                var finalpoc = self.Position;
                if (pawn.Position.x == self.Position.x)
                {
                    finalpoc = pawn.Position.z > self.Position.z ? eway[5] : eway[3];
                }
                else if (pawn.Position.z == self.Position.z)
                {
                    finalpoc = pawn.Position.x > self.Position.x ? eway[7] : eway[1];
                }
                else if (pawn.Position.x > self.Position.x)
                {
                    finalpoc = pawn.Position.z > self.Position.z ? eway[8] : eway[6];
                }
                else if (pawn.Position.x < self.Position.x)
                {
                    finalpoc = pawn.Position.z > self.Position.z ? eway[2] : eway[0];
                }


                var finalPawn = new List <Pawn>();
                foreach (var ic in pawn.CellsAdjacent8WayAndInside())
                {
                    foreach (var tt in pawn.Map.thingGrid.ThingsAt(ic))
                    {
                        if (tt is not Pawn thing || tt == self || tt == pawn || thing.Position == self.Position)
                        {
                            continue;
                        }

                        if (thing.Faction != self.Faction)
                        {
                            finalPawn.Add(thing);
                        }
                    }
                }

                if (pawn.Faction != self.Faction)
                {
                    finalPawn.Add(pawn);
                }

                foreach (var ttg in finalPawn)
                {
                    ttg.pather.StartPath(finalpoc, PathEndMode.Touch);
                    ttg.Position = finalpoc;
                    ttg.pather.StopDead();
                    if (ttg.jobs.curJob != null)
                    {
                        ttg.jobs.curDriver.Notify_PatherArrived();
                    }

                    ttg.stances.stunner.StunFor(120, self);
                }


                SoundDef.Named("Mag_1Skill").PlayOneShot(self);
                float damage = 30 + (2 * WarframeStaticMethods.GetWFLevel(self) / 5);
                var   dinfo  = new DamageInfo(DefDatabase <DamageDef> .GetNamed("Mag"), damage, 1, -1, self, null, null,
                                              DamageInfo.SourceCategory.ThingOrUnknown, pawn);
                foreach (var p in finalPawn)
                {
                    if (p.Faction == self.Faction)
                    {
                        continue;
                    }

                    WarframeStaticMethods.ShowDamageAmount(p, damage.ToString("f0"));
                    p.TakeDamage(dinfo);
                }

                // WarframeStaticMethods.showDamageAmount(self, damage.ToString("f0"));
                WarframeStaticMethods.StartCooldown(self, ck.cooldownTime, 1,
                                                    WarframeStaticMethods.GetArmor(self).TryGetComp <CompWarframeSkill>().Props.mana1);
            };


            return(ck);
        }
Exemplo n.º 5
0
        //咖喱技能1
        public static Command_CastSkillTargeting Skill1()
        {
            var ck = new Command_CastSkillTargeting
            {
                defaultLabel    = "ExcaliburSkill1.name".Translate(),
                icon            = ContentFinder <Texture2D> .Get("Skills/ExcaliburSkill1"),
                targetingParams = WarframeStaticMethods.OnlyPawn(),
                cooldownTime    = 0.2f,
                range           = 10f
            };

            ck.finishAction = delegate
            {
                GenDraw.DrawFieldEdges(
                    WarframeStaticMethods.GetCellsAround(ck.self.Position, ck.self.Map, ck.range));
            };
            ck.hotKey = KeyBindingDefOf.Misc5;
            ck.action = delegate(Pawn self, Thing target)
            {
                // GenExplosion.DoExplosion(self.Position, self.Map, 3.5f, DamageDefOf.Bomb, self, -1, -1, null, null, null, null, null, 0, 1, false, null, 0, 1, 0, false);
                if (!WarframeStaticMethods.GetCellsAround(self.Position, self.Map, ck.range).Contains(target.Position))
                {
                    SoundDefOf.ClickReject.PlayOneShotOnCamera();
                    return;
                }

                var linec = WarframeStaticMethods.GetLineCell(self, target);
                if (linec == null)
                {
                    Messages.Message("BeBlockedByBuilding".Translate(), MessageTypeDefOf.RejectInput, false);
                    return;
                }


                self.pather.StartPath(target, PathEndMode.Touch);
                self.Position = target.Position;
                self.pather.StopDead();
                if (self.jobs.curJob != null)
                {
                    self.jobs.curDriver.Notify_PatherArrived();
                }

                SoundDef.Named("Excalibur_SlashDash").PlayOneShot(self);
                float damage = 30 + (2 * WarframeStaticMethods.GetWFLevel(self) / 5);
                var   dinfo  = new DamageInfo(DamageDefOf.Cut, damage, 1, -1, self, null, null,
                                              DamageInfo.SourceCategory.ThingOrUnknown, target);
                foreach (var p in linec)
                {
                    if (p.Faction == self.Faction)
                    {
                        continue;
                    }

                    WarframeStaticMethods.ShowDamageAmount(p, damage.ToString("f0"));
                    p.TakeDamage(dinfo);
                }

                // WarframeStaticMethods.showDamageAmount(self, damage.ToString("f0"));
                WarframeStaticMethods.StartCooldown(self, ck.cooldownTime, 1,
                                                    WarframeStaticMethods.GetArmor(self).TryGetComp <CompWarframeSkill>().Props.mana1);
            };


            return(ck);
        }
Exemplo n.º 6
0
        //咖喱技能1
        public static Command_CastSkill Skill1()
        {
            var ck = new Command_CastSkillTargetingFloor
            {
                defaultLabel    = "VoltSkill1.name".Translate(),
                icon            = ContentFinder <Texture2D> .Get("Skills/VoltSkill1"),
                targetingParams = WarframeStaticMethods.JumpTP(),
                cooldownTime    = 0.2f,
                range           = 11f
            };

            ck.finishAction = delegate
            {
                GenDraw.DrawRadiusRing(UI.MouseCell(), 5f * (1 + (ck.self.GetLevel() * 1f / 30f)));
                GenDraw.DrawFieldEdges(WarframeStaticMethods.GetCellsAround(ck.self.Position, ck.self.Map, ck.range));
            };
            ck.hotKey = KeyBindingDefOf.Misc5;
            ck.action = delegate(Pawn self, LocalTargetInfo target)
            {
                // GenExplosion.DoExplosion(self.Position, self.Map, 3.5f, DaVolteDefOf.Bomb, self, -1, -1, null, null, null, null, null, 0, 1, false, null, 0, 1, 0, false);
                if (!WarframeStaticMethods.GetCellsAround(self.Position, self.Map, ck.range).Contains(target.Cell))
                {
                    SoundDefOf.ClickReject.PlayOneShotOnCamera();
                    return;
                }

                var cells = new List <IntVec3>();
                var num   = GenRadial.NumCellsInRadius(5f * (1 + (ck.self.GetLevel() * 1f / 30f)));
                for (var i = 0; i < num; i++)
                {
                    cells.Add(target.Cell + GenRadial.RadialPattern[i]);
                }

                var   ps     = 0;
                float damage = 20 + (2 * WarframeStaticMethods.GetWFLevel(self) / 5);
                var   dinfo  = new DamageInfo(DefDatabase <DamageDef> .GetNamed("Mag"), damage, 0, -1, self);
                foreach (var ic in cells)
                {
                    foreach (var th in self.Map.thingGrid.ThingsAt(ic))
                    {
                        if (th is not Pawn pawn || pawn.Faction == self.Faction)
                        {
                            continue;
                        }

                        ps++;
                        pawn.stances.stunner.StunFor(180, self);
                        pawn.TakeDamage(dinfo);
                        WarframeStaticMethods.ShowDamageAmount(pawn, damage.ToString("f0"));
                        if (ps >= 2 * (1 + (self.GetLevel() * 1f / 10f)))
                        {
                            break;
                        }
                    }

                    if (ps >= 2 * (1 + (self.GetLevel() * 1f / 10f)))
                    {
                        break;
                    }
                }


                SoundDef.Named("Volt_1Skill").PlayOneShot(self);

                WarframeStaticMethods.StartCooldown(self, ck.cooldownTime, 1,
                                                    WarframeStaticMethods.GetArmor(self).TryGetComp <CompWarframeSkill>().Props.mana1);
            };


            return(ck);
        }