Example #1
0
        //咖喱技能1
        public static Command_CastSkillTargeting Skill1()
        {
            var ck = new Command_CastSkillTargeting
            {
                defaultLabel    = "AshSkill1.name".Translate(),
                icon            = ContentFinder <Texture2D> .Get("Skills/AshSkill1"),
                targetingParams = WarframeStaticMethods.OnlyPawn(),
                cooldownTime    = 0.2f,
                range           = 35f
            };

            ck.finishAction = delegate
            {
                //GenDraw.DrawFieldEdges(WarframeStaticMethods.GetCellsAround(ck.self.Position, ck.self.Map, ck.range));
                GenDraw.DrawRadiusRing(ck.self.Position, 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 (!target.Position.InHorDistOf(self.Position,
                                                 ck.range)) //(!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;
                }


                SoundDef.Named("Ash_1Skill").PlayOneShot(self);
                var time = 1;
                if (self.GetLevel() > 15)
                {
                    time = 2;
                }

                for (var i = 0; i < time; i++)
                {
                    var projectile2 = (Bullet_1Ash)GenSpawn.Spawn(ThingDef.Named("Bullet_Ash1Bullet"),
                                                                  self.Position + new IntVec3(i, 0, 0), self.Map);
                    var   hitTypes = ProjectileHitFlags.All;
                    Thing gun      = null;
                    projectile2.target = target as Pawn;
                    if (self.equipment is { Primary: { } })
                    {
                        gun = self.equipment.Primary;
                    }

                    projectile2.Launch(self, target.Position, target, hitTypes, false, gun);
                }
Example #2
0
        //咖喱技能2
        public static Command_CastSkill Skill2()
        {
            var ck = new Command_CastSkillTargeting
            {
                defaultLabel    = "MagSkill2.name".Translate(),
                icon            = ContentFinder <Texture2D> .Get("Skills/MagSkill2"),
                targetingParams = WarframeStaticMethods.OnlyPawn(),
                cooldownTime    = 0.2f,
                range           = 18f,
                hotKey          = KeyBindingDefOf.Misc8
            };

            ck.finishAction = delegate
            {
                GenDraw.DrawFieldEdges(
                    WarframeStaticMethods.GetCellsAround(ck.self.Position, ck.self.Map, ck.range));
            };
            ck.action = delegate(Pawn self, Thing target)
            {
                if (!WarframeStaticMethods.GetCellsAround(self.Position, self.Map, ck.range)
                    .Contains(target.Position) || target.Faction == self.Faction)
                {
                    SoundDefOf.ClickReject.PlayOneShotOnCamera();
                    return;
                }

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


                var hediff_Magnetize =
                    (Hediff_Magnetize)HediffMaker.MakeHediff(HediffDef.Named("Magnetize"), target as Pawn);
                hediff_Magnetize.self = self;
                (target as Pawn)?.health.AddHediff(hediff_Magnetize);


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


            return(ck);
        }
Example #3
0
        //咖喱技能1
        public static Command_CastSkillTargeting Skill1()
        {
            var ck = new Command_CastSkillTargeting
            {
                defaultLabel    = "ValkyrSkill1.name".Translate(),
                icon            = ContentFinder <Texture2D> .Get("Skills/ValkyrSkill1"),
                targetingParams = WarframeStaticMethods.OnlyPawn(),
                cooldownTime    = 0.7f,
                range           = 35f
            };

            ck.finishAction = delegate
            {
                //GenDraw.DrawFieldEdges(WarframeStaticMethods.GetCellsAround(ck.self.Position, ck.self.Map, ck.range));
                GenDraw.DrawRadiusRing(ck.self.Position, 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 (!target.Position.InHorDistOf(self.Position,
                                                 ck.range)) //(!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;
                }


                SoundDef.Named("Valkyr_1Skill").PlayOneShot(self);
                var ash4t = (Valkyr1Thing)ThingMaker.MakeThing(ThingDef.Named("ValkyrSkill1Item"));
                ash4t.self      = self;
                ash4t.target    = target as Pawn;
                ash4t.startTick = Find.TickManager.TicksGame;
                GenSpawn.Spawn(ash4t, self.Position, self.Map);

                var hediff = (Hediff_Valkyr1Skill)HediffMaker.MakeHediff(HediffDef.Named("WFValkyr1Skill_Mul"), self);
                WarframeStaticMethods.StartCooldown(self, ck.cooldownTime, 1,
                                                    WarframeStaticMethods.GetArmor(self).TryGetComp <CompWarframeSkill>().Props.mana1);

                foreach (var hef in self.health.hediffSet.hediffs)
                {
                    if (hef.def.defName != "WFValkyr1Skill_Mul")
                    {
                        continue;
                    }

                    if (hef is Hediff_Valkyr1Skill hev)
                    {
                        hev.mul += 2;
                    }

                    return;
                }


                self.health.AddHediff(hediff);
            };


            return(ck);
        }
Example #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);
        }
Example #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);
        }