Example #1
0
        //咖喱技能3
        public static Command_CastSkill Skill3()
        {
            var ck = new Command_CastSkill
            {
                defaultLabel    = "MagSkill3.name".Translate(),
                icon            = ContentFinder <Texture2D> .Get("Skills/MagSkill3"),
                targetingParams = WarframeStaticMethods.OnlyPawn(),
                cooldownTime    = 3f,
                range           = 18f,
                hotKey          = KeyBindingDefOf.Misc4
            };

            ck.action = delegate(Pawn self)
            {
                var mag3s = (Mag3SkillThing)ThingMaker.MakeThing(ThingDef.Named("MagSkill3Item"));
                mag3s.self   = self;
                mag3s.range  = (int)ck.range;
                mag3s.damage = 20 * (1 + (self.GetLevel() / 60f));
                GenSpawn.Spawn(mag3s, self.Position, self.Map);
                SoundDef.Named("Mag_3Skill").PlayOneShot(self);

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


            return(ck);
        }
Example #2
0
        //咖喱技能4
        public static Command_CastSkill Skill4()
        {
            var ck = new Command_CastSkill
            {
                defaultLabel    = "ExcaliburSkill4.name".Translate(),
                icon            = ContentFinder <Texture2D> .Get("Skills/ExcaliburSkill4"),
                targetingParams = WarframeStaticMethods.OnlyPawn(),
                cooldownTime    = 0.2f,
                range           = 1f,
                hotKey          = KeyBindingDefOf.Misc7
            };

            // WarframeArmor sa = WarframeStaticMethods.getArmor(ck.self);

            ck.action = delegate(Pawn self)
            {
                var wa = WarframeStaticMethods.GetArmor(self);
                if (wa.tillSkillOpen > 0)
                {
                    EndSkill4(self);

                    return;
                }


                Find.CameraDriver.shaker.DoShake(20000f * 15f /
                                                 (self.Position.ToVector3Shifted() - Find.Camera.transform.position)
                                                 .magnitude);
                SoundDef.Named("Excalibur_ExaltedBladePre").PlayOneShot(self);
                {
                    var mote = (Mote)ThingMaker.MakeThing(ThingDef.Named("Mote_2ExFlash"));
                    mote.exactPosition = self.Position.ToVector3Shifted();
                    mote.Scale         = Mathf.Max(10f, 15f);
                    mote.rotationRate  = 1.2f;
                    GenSpawn.Spawn(mote, self.Position + new IntVec3(0, 1, 0), self.Map);
                }

                //WFModBase.Instance._WFcontrolstorage.saveOldGun(self,self.equipment.Primary);
                if (self.equipment.Primary != null)
                {
                    wa.oldWeapon.Add(self.equipment.Primary);
                }

                wa.tillSkillOpen = 4;
                wa.tillSkillMul  = 0.2f;
                self.equipment.Remove(self.equipment.Primary); //Primary.Destroy(DestroyMode.Vanish);
                self.equipment.AddEquipment(
                    (ThingWithComps)ThingMaker.MakeThing(ThingDef.Named("Excalibur_SkillBlade")));
                self.stances.stunner.StunFor(60, self);

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


            return(ck);
        }
Example #3
0
        //咖喱技能4
        public static Command_CastSkill Skill4()
        {
            var ck = new Command_CastSkill
            {
                defaultLabel    = "MesaSkill4.name".Translate(),
                icon            = ContentFinder <Texture2D> .Get("Skills/MesaSkill4"),
                targetingParams = WarframeStaticMethods.OnlyPawn(),
                cooldownTime    = 0.2f,
                range           = 1f,
                hotKey          = KeyBindingDefOf.Misc7
            };

            // WarframeArmor sa = WarframeStaticMethods.GetArmor(ck.self);

            ck.action = delegate(Pawn self)
            {
                var wa = WarframeStaticMethods.GetArmor(self);
                if (wa.tillSkillOpen > 0)
                {
                    EndSkill4(self);

                    return;
                }


                Find.CameraDriver.shaker.DoShake(20000f * 15f /
                                                 (self.Position.ToVector3Shifted() - Find.Camera.transform.position)
                                                 .magnitude);
                SoundDef.Named("Mesa_4Skill").PlayOneShot(self);
                {
                    FleckMaker.ThrowMicroSparks(self.Position.ToVector3(), self.Map);
                }

                //WFModBase.Instance._WFcontrolstorage.saveOldGun(self,self.equipment.Primary);
                if (self.equipment.Primary != null)
                {
                    wa.oldWeapon.Add(self.equipment.Primary);
                }

                wa.tillSkillOpen = 4;
                wa.tillSkillMul  = 0.6f;
                self.equipment.Remove(self.equipment.Primary); //Primary.Destroy(DestroyMode.Vanish);
                self.equipment.AddEquipment((ThingWithComps)ThingMaker.MakeThing(ThingDef.Named("Mesa_SkillGun")));
                self.stances.stunner.StunFor(10, self);

                var hediff = (Hediff_NoMove)HediffMaker.MakeHediff(HediffDef.Named("WFMesa4Skill_Nomove"), self);

                self.health.AddHediff(hediff);


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


            return(ck);
        }
Example #4
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);
        }
Example #5
0
        //咖喱技能1
        public static Command_CastSkill Skill1()
        {
            var ck = new Command_CastSkill
            {
                defaultLabel    = "MesaSkill1.name".Translate(),
                icon            = ContentFinder <Texture2D> .Get("Skills/MesaSkill1"),
                targetingParams = WarframeStaticMethods.OnlyPawn(),
                cooldownTime    = 0.2f,
                range           = 1f,
                hotKey          = KeyBindingDefOf.Misc5
            };

            ck.action = delegate(Pawn self)
            {
                foreach (var hef in self.health.hediffSet.hediffs)
                {
                    if (hef.def.defName == "WFMesa1Skill_Start")
                    {
                        var hediffA = hef as Hediff_Mesa1SkillA;
                        var hediffB =
                            (Hediff_Mesa1SkillB)HediffMaker.MakeHediff(HediffDef.Named("WFMesa1Skill_End"), self);
                        if (hediffA != null)
                        {
                            hediffB.sdamage = hediffA.sdamage;
                        }

                        self.health.RemoveHediff(hef);
                        self.health.AddHediff(hediffB);
                        return;
                    }

                    if (hef.def.defName != "WFMesa1Skill_End")
                    {
                        continue;
                    }

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


                SoundDef.Named("Mesa_1Skill").PlayOneShot(self);
                var hediff = (Hediff_Mesa1SkillA)HediffMaker.MakeHediff(HediffDef.Named("WFMesa1Skill_Start"), self);
                hediff.sdamage = 0;
                self.health.AddHediff(hediff);


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


            return(ck);
        }
Example #6
0
        //咖喱技能2
        public static Command_CastSkill Skill2()
        {
            var ck = new Command_CastSkill
            {
                defaultLabel    = "ValkyrSkill2.name".Translate(),
                icon            = ContentFinder <Texture2D> .Get("Skills/ValkyrSkill2"),
                targetingParams = WarframeStaticMethods.OnlyPawn(),
                cooldownTime    = 2f,
                range           = 16f,
                hotKey          = KeyBindingDefOf.Misc8
            };

            ck.action = delegate(Pawn self)
            {
                SoundDef.Named("Valkyr_2Skill").PlayOneShot(self);
                self.stances.stunner.StunFor(40, self);

                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))
                        {
                            var hediff =
                                (Hediff_Valkyr2Skill)HediffMaker.MakeHediff(
                                    HediffDef.Named("WFValkyr2Skill_Enemy"), self);
                            hediff.self = self;
                            pawn.health.AddHediff(hediff);
                        }
                        else
                        {
                            var hediff =
                                (Hediff_Valkyr2Skill)HediffMaker.MakeHediff(HediffDef.Named("WFValkyr2Skill_Ally"),
                                                                            self);
                            hediff.self = self;
                            pawn.health.AddHediff(hediff);
                        }
                    }
                }


                WarframeStaticMethods.StartCooldown(self, ck.cooldownTime * (1 + (self.GetLevel() * 1f / 10f)), 2,
                                                    WarframeStaticMethods.GetArmor(self).TryGetComp <CompWarframeSkill>().Props.mana2);
            };


            return(ck);
        }
Example #7
0
        //咖喱技能2
        public static Command_CastSkill Skill2()
        {
            var ck = new Command_CastSkill
            {
                defaultLabel    = "VoltSkill2.name".Translate(),
                icon            = ContentFinder <Texture2D> .Get("Skills/VoltSkill2"),
                targetingParams = WarframeStaticMethods.OnlyPawn(),
                cooldownTime    = 0.2f,
                range           = 2f,
                hotKey          = KeyBindingDefOf.Misc8
            };

            ck.action = delegate(Pawn self)
            {
                SoundDef.Named("Volt_2Skill").PlayOneShot(self);
                foreach (var ic in WarframeStaticMethods.GetCellsAround(self.Position, self.Map, ck.range))
                {
                    foreach (var th in self.Map.thingGrid.ThingsAt(ic))
                    {
                        if (!(th is Pawn pawn) || pawn.Faction == null || pawn.Faction != self.Faction ||
                            !pawn.IsWarframe())
                        {
                            continue;
                        }

                        var hediff_Magnetize =
                            (Hediff_VoltSpeedUp)HediffMaker.MakeHediff(HediffDef.Named("VoltSpeedUp"), self);
                        hediff_Magnetize.level = (int)self.GetLevel();
                        pawn.health.AddHediff(hediff_Magnetize);
                        WarframeStaticMethods.ShowColorText(pawn, "Speed Up!", new Color(0.2f, 0.4f, 0.8f),
                                                            GameFont.Small);
                    }
                }

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


            return(ck);
        }
Example #8
0
        //咖喱技能4
        public static Command_CastSkill Skill4()
        {
            var ck = new Command_CastSkill
            {
                defaultLabel    = "MagSkill4.name".Translate(),
                icon            = ContentFinder <Texture2D> .Get("Skills/MagSkill4"),
                targetingParams = WarframeStaticMethods.OnlyPawn(),
                cooldownTime    = 4f,
                range           = 12f,
                hotKey          = KeyBindingDefOf.Misc7
            };

            // WarframeArmor sa = WarframeStaticMethods.getArmor(ck.self);

            ck.action = delegate(Pawn self)
            {
                SoundDef.Named("Mag_4Skill").PlayOneShot(self);
                {
                    var mote = (Mote)ThingMaker.MakeThing(ThingDef.Named("Mote_2ExFlash"));
                    mote.exactPosition = self.Position.ToVector3Shifted();
                    mote.Scale         = Mathf.Max(10f, 15f);
                    mote.rotationRate  = 1.2f;
                    GenSpawn.Spawn(mote, self.Position + new IntVec3(0, 1, 0), self.Map);
                }

                var thing = (Mag4SkillThing)ThingMaker.MakeThing(ThingDef.Named("MagSkill4Item"));
                thing.self   = self;
                thing.range  = (int)ck.range;
                thing.damage = 60 * (1 + (self.GetLevel() / 60f));
                GenSpawn.Spawn(thing, self.Position, self.Map);
                self.stances.stunner.StunFor(180, self);

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


            return(ck);
        }
Example #9
0
        //咖喱技能2
        public static Command_CastSkill Skill2()
        {
            var ck = new Command_CastSkill
            {
                defaultLabel    = "MesaSkill2.name".Translate(),
                icon            = ContentFinder <Texture2D> .Get("Skills/MesaSkill2"),
                targetingParams = WarframeStaticMethods.OnlyPawn(),
                cooldownTime    = 1f,
                range           = 1f,
                hotKey          = KeyBindingDefOf.Misc8
            };

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

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


                SoundDef.Named("Mesa_2Skill").PlayOneShot(self);
                var hediff = (Hediff_Mesa2Skill)HediffMaker.MakeHediff(HediffDef.Named("WFMesa2Skill_Mesa"), self);
                hediff.level = (int)self.GetLevel();
                self.health.AddHediff(hediff);


                WarframeStaticMethods.StartCooldown(self, ck.cooldownTime * (1 + (self.GetLevel() * 1f / 10f)), 2,
                                                    WarframeStaticMethods.GetArmor(self).TryGetComp <CompWarframeSkill>().Props.mana2);
            };


            return(ck);
        }
Example #10
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);
        }
Example #11
0
        //咖喱技能3
        public static Command_CastSkill Skill3()
        {
            var ck = new Command_CastSkill
            {
                defaultLabel    = "ExcaliburSkill3.name".Translate(),
                icon            = ContentFinder <Texture2D> .Get("Skills/ExcaliburSkill3"),
                targetingParams = WarframeStaticMethods.OnlyPawn(),
                cooldownTime    = 0.2f,
                range           = 18f,
                hotKey          = KeyBindingDefOf.Misc4
            };

            ck.action = delegate(Pawn self)
            {
                /*
                 * float damage = 120 + (8 * WarframeStaticMethods.getWFLevel(self) / 5);
                 *
                 * SoundDef.Named("Excalibur_RadialJavelin").PlayOneShot(self);
                 * foreach (IntVec3 iv in WarframeStaticMethods.getCellsAround(self.Position, self.Map, ck.range))
                 * {
                 *  foreach (Thing t in self.Map.thingGrid.ThingsAt(iv))
                 *  {
                 *      if (t is Pawn)
                 *      {
                 *          if ((t as Pawn) != self && (t as Pawn).Faction!=self.Faction)
                 *          {
                 *              WarframeStaticMethods.showDamageAmount(t, damage.ToString("f0"));
                 *              float totaldamage = 0;
                 *              DamageInfo dinfo = new DamageInfo(DamageDefOf.Cut, damage, 1, -1, self, null, null, DamageInfo.SourceCategory.ThingOrUnknown, null);
                 *              foreach (BodyPartRecord bpr in (t as Pawn).health.hediffSet.GetNotMissingParts(BodyPartHeight.Undefined,BodyPartDepth.Outside))
                 *              {
                 *
                 *
                 *
                 *                      //dinfo.SetHitPart(bpr);
                 *
                 *                  (t as Pawn).TakeDamage(dinfo);
                 *                      totaldamage += bpr.def.hitPoints;
                 *                      dinfo.SetAmount(damage-totaldamage);
                 *
                 *
                 *                  if (totaldamage > damage)
                 *                  {
                 *                      break;
                 *                  }
                 *              }
                 *
                 *
                 *
                 *
                 *
                 *
                 *
                 *
                 *              {
                 *                   Mote mote = (Mote)ThingMaker.MakeThing(ThingDef.Named("Mote_2ExFlash"), null);
                 *                  mote.exactPosition = t.Position.ToVector3Shifted();
                 *                  mote.Scale = (float)Mathf.Max(10f,15f);
                 *                  mote.rotationRate = 1.2f;
                 *                 // mote.Scale = 0.2f;
                 *                  GenSpawn.Spawn(mote, t.Position + new IntVec3(0, 1, 0), self.Map, WipeMode.Vanish);
                 *              }
                 *          }
                 *      }
                 *  }
                 * }
                 */
                SoundDef.Named("Excalibur_RadialJavelin").PlayOneShot(self);
                self.stances.stunner.StunFor(60, self);
                {
                    var mote = (Mote)ThingMaker.MakeThing(ThingDef.Named("Mote_2ExFlash"));
                    mote.exactPosition = self.Position.ToVector3Shifted();
                    mote.Scale         = Mathf.Max(10f, 15f);
                    mote.rotationRate  = 1.2f;
                    GenSpawn.Spawn(mote, self.Position + new IntVec3(0, 1, 0), self.Map);
                }
                var thing = (ExcaliburSkill3Item)ThingMaker.MakeThing(ThingDef.Named("ExcaliburSkill3Item"));
                thing.self  = self;
                thing.range = ck.range;

                thing.createdTick = Find.TickManager.TicksGame;
                GenSpawn.Spawn(thing, self.Position, self.Map);
                WarframeStaticMethods.StartCooldown(self, ck.cooldownTime, 3,
                                                    WarframeStaticMethods.GetArmor(self).TryGetComp <CompWarframeSkill>().Props.mana3);
            };


            return(ck);
        }