Esempio n. 1
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);
        }