Пример #1
0
        //咖喱技能3
        public static Command_CastSkill Skill3()
        {
            var ck = new Command_CastSkill
            {
                defaultLabel    = "MesaSkill3.name".Translate(),
                icon            = ContentFinder <Texture2D> .Get("Skills/MesaSkill3"),
                targetingParams = WarframeStaticMethods.JumpTP(),
                cooldownTime    = 1f,
                range           = 1f,
                hotKey          = KeyBindingDefOf.Misc4
            };

            ck.action = delegate(Pawn self)
            {
                foreach (var hef in self.health.hediffSet.hediffs)
                {
                    if (hef.def.defName != "WFMesa3Skill_Mesa")
                    {
                        continue;
                    }

                    Messages.Message("MesaSkillUsing".Translate(), MessageTypeDefOf.RejectInput, false);
                    return;
                }

                SoundDef.Named("Mesa_3Skill").PlayOneShot(self);
                var hediff = (Hediff_Mesa3Skill)HediffMaker.MakeHediff(HediffDef.Named("WFMesa3Skill_Mesa"), self);
                hediff.self = self;
                self.health.AddHediff(hediff);

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


            return(ck);
        }
Пример #2
0
        //咖喱技能3
        public static Command_CastSkill Skill3()
        {
            var ck = new Command_CastSkill
            {
                defaultLabel    = "ValkyrSkill3.name".Translate(),
                icon            = ContentFinder <Texture2D> .Get("Skills/ValkyrSkill3"),
                targetingParams = WarframeStaticMethods.JumpTP(),
                cooldownTime    = 0.2f,
                range           = 10f,
                hotKey          = KeyBindingDefOf.Misc4
            };

            ck.action = delegate(Pawn self)
            {
                SoundDef.Named("Valkyr_3Skill").PlayOneShot(self);
                var wb       = WarframeStaticMethods.GetBelt(self);
                var damage   = wb.Energy * 5;
                var levelmul = 2 + (1 * self.GetLevel() / 30f);
                damage *= levelmul;


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

                        if (!pawn.HostileTo(self.Faction))
                        {
                            continue;
                        }

                        pawn.stances.stunner.StunFor(150, self);
                        var dinfo = new DamageInfo(DamageDefOf.Blunt, damage, 0, -1, self, null, null,
                                                   DamageInfo.SourceCategory.ThingOrUnknown, pawn);
                        WarframeStaticMethods.ShowDamageAmount(pawn, damage + "");
                        pawn.TakeDamage(dinfo);

                        var dataStatic = FleckMaker.GetDataStatic(pawn.Position.ToVector3(), self.Map,
                                                                  FleckDefOf.Smoke, Rand.Range(1.5f, 2.5f));
                        dataStatic.rotationRate  = Rand.Range(-30f, 30f);
                        dataStatic.velocityAngle = Rand.Range(30, 40);
                        dataStatic.velocitySpeed = Rand.Range(0.5f, 0.7f);
                        dataStatic.instanceColor = Color.white;
                        self.Map.flecks.CreateFleck(dataStatic);
                    }
                }


                var adde = wb.Energy * -0.33f;
                wb.AddEnergy(adde * 100);
                var wfdinfo = new DamageInfo(DamageDefOf.Stun, 1, 0, -1, self, null, null,
                                             DamageInfo.SourceCategory.ThingOrUnknown, self);
                self.TakeDamage(wfdinfo);

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


            return(ck);
        }
Пример #3
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);
        }
Пример #4
0
        //咖喱技能3
        public static Command_CastSkill Skill3()
        {
            var ck = new Command_CastSkillTargetingFloor
            {
                defaultLabel    = "VoltSkill3.name".Translate(),
                icon            = ContentFinder <Texture2D> .Get("Skills/VoltSkill3"),
                targetingParams = WarframeStaticMethods.JumpTP(),
                cooldownTime    = 0.2f,
                range           = 2f,
                hotKey          = KeyBindingDefOf.Misc4
            };

            ck.finishAction = delegate { GenDraw.DrawFieldEdges(ck.self.CellsAdjacent8WayAndInside().ToList()); };
            ck.action       = delegate(Pawn self, LocalTargetInfo target)
            {
                if (!self.CellsAdjacent8WayAndInside().Contains(target.Cell) || target.Cell == self.Position)
                {
                    SoundDefOf.ClickReject.PlayOneShotOnCamera();
                    return;
                }

                var dire = new List <IntVec3> {
                    target.Cell
                };
                var rotat = 0f;
                if (target.Cell.x == self.Position.x)
                {
                    dire.Add(target.Cell + new IntVec3(-1, 0, 0));
                    dire.Add(target.Cell + new IntVec3(1, 0, 0));
                }
                else if (target.Cell.z == self.Position.z)
                {
                    dire.Add(target.Cell + new IntVec3(0, 0, -1));
                    dire.Add(target.Cell + new IntVec3(0, 0, 1));
                    rotat = 90f;
                }
                else if (target.Cell.x > self.Position.x)
                {
                    if (target.Cell.z > self.Position.z)
                    {
                        dire.Add(target.Cell + new IntVec3(-1, 0, 1));
                        dire.Add(target.Cell + new IntVec3(1, 0, -1));
                        dire.Add(target.Cell + new IntVec3(-1, 0, 0));
                        dire.Add(target.Cell + new IntVec3(0, 0, -1));
                        rotat = 45f;
                    }
                    else
                    {
                        dire.Add(target.Cell + new IntVec3(-1, 0, -1));
                        dire.Add(target.Cell + new IntVec3(1, 0, 1));
                        dire.Add(target.Cell + new IntVec3(-1, 0, 0));
                        dire.Add(target.Cell + new IntVec3(0, 0, 1));
                        rotat = 135f;
                    }
                }
                else if (target.Cell.x < self.Position.x)
                {
                    if (target.Cell.z > self.Position.z)
                    {
                        dire.Add(target.Cell + new IntVec3(-1, 0, -1));
                        dire.Add(target.Cell + new IntVec3(1, 0, 1));
                        dire.Add(target.Cell + new IntVec3(1, 0, 0));
                        dire.Add(target.Cell + new IntVec3(0, 0, -1));
                        rotat = 135f;
                    }
                    else
                    {
                        dire.Add(target.Cell + new IntVec3(-1, 0, 1));
                        dire.Add(target.Cell + new IntVec3(1, 0, -1));
                        dire.Add(target.Cell + new IntVec3(1, 0, 0));
                        dire.Add(target.Cell + new IntVec3(0, 0, 1));
                        rotat = 45f;
                    }
                }


                var Volt3s = (Volt3SkillThing)ThingMaker.MakeThing(ThingDef.Named("VoltSkill3Item"));
                Volt3s.self  = self;
                Volt3s.dire  = dire;
                Volt3s.rotat = rotat;
                GenSpawn.Spawn(Volt3s, target.Cell, self.Map);
                SoundDef.Named("Volt_3Skill").PlayOneShot(self);

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


            return(ck);
        }