public static void Prefix(Thing __instance, ref DamageInfo dinfo)
        {
            if (__instance is not Pawn pawn)
            {
                return;
            }

            if (!pawn.IsWarframe())
            {
                return;
            }

            foreach (var hed in pawn.health.hediffSet.hediffs)
            {
                if (hed.def.defName != "WFValkyr2Skill_Ally")
                {
                    continue;
                }

                var finaldmg = dinfo.Amount * (1 - (0.25f * (1 + (pawn.GetLevel() * 1f / 30f))));
                var dinfonew = new DamageInfo(dinfo.Def, finaldmg, dinfo.ArmorPenetrationInt, dinfo.Angle,
                                              dinfo.Instigator, null, dinfo.Weapon, DamageInfo.SourceCategory.ThingOrUnknown,
                                              dinfo.IntendedTarget);
                dinfo = dinfonew;
                WarframeStaticMethods.ShowColorText(pawn, "final damage:" + finaldmg, Color.yellow,
                                                    GameFont.Small);
                break;
            }
        }
Example #2
0
        public void resetSpeed()
        {
            if (lastShotTick == 0 || Find.TickManager.TicksGame - lastShotTick < 60)
            {
                return;
            }

            newWarmupTime = verbProps.warmupTime;
            lastShotTick  = 0;
            WarframeStaticMethods.ShowColorText(caster, "ShootSpeedReset!", Color.cyan, GameFont.Medium);
        }
        public static void Prefix(Thing __instance, ref DamageInfo dinfo)
        {
            if (__instance is not Pawn)
            {
                return;
            }

            if (dinfo.Instigator is not Pawn wf || !wf.IsWarframe())
            {
                return;
            }

            if (wf.kindDef.defName != "Warframe_Valkyr")
            {
                return;
            }

            foreach (var hed in wf.health.hediffSet.hediffs)
            {
                if (hed.def.defName != "WFGod")
                {
                    continue;
                }

                var finaldmg = dinfo.Amount * (1 + (wf.GetLevel() * 1f / 20f)) * criMul();
                var heal     = finaldmg * 0.01f * (1 + (wf.GetLevel() / 6f));


                var dinfonew = new DamageInfo(dinfo.Def, finaldmg, dinfo.ArmorPenetrationInt, dinfo.Angle,
                                              dinfo.Instigator, null, dinfo.Weapon, DamageInfo.SourceCategory.ThingOrUnknown,
                                              dinfo.IntendedTarget);
                dinfo = dinfonew;


                if ((from x in wf.health.hediffSet.GetHediffs <Hediff_Injury>()
                     where x.CanHealNaturally() || x.CanHealFromTending()
                     select x).TryRandomElement(out var hediff_Injury))
                {
                    hediff_Injury.Heal(10f);
                    WarframeStaticMethods.ShowColorText(wf, "HP+" + heal, new Color(0.2f, 1, 0.1f),
                                                        GameFont.Small);
                }


                //  WarframeStaticMethods.ShowColorText(wf, "final damage:" + finaldmg, Color.yellow, GameFont.Small);
                break;
            }
        }
Example #4
0
        // Token: 0x060026E7 RID: 9959 RVA: 0x00127F60 File Offset: 0x00126360
        protected override void Impact(Thing hitThing)
        {
            var map = Map;

            base.Impact(hitThing);
            var battleLogEntry_RangedImpact = new BattleLogEntry_RangedImpact(launcher, hitThing,
                                                                              intendedTarget.Thing, equipmentDef, def, targetCoverDef);

            Find.BattleLog.Add(battleLogEntry_RangedImpact);
            if (hitThing != null)
            {
                var   damageDef        = def.projectile.damageDef;
                float amount           = DamageAmount;
                var   armorPenetration = ArmorPenetration;
                var   y          = ExactRotation.eulerAngles.y;
                var   instigator = launcher;
                var   thingDef   = equipmentDef;
                var   finaldmg   = changeDamage(amount);
                var   dinfo      = new DamageInfo(damageDef, finaldmg, armorPenetration, y, instigator, null, thingDef,
                                                  DamageInfo.SourceCategory.ThingOrUnknown, intendedTarget.Thing);
                if (isCR)
                {
                    WarframeStaticMethods.ShowColorText(hitThing, "X3 -" + finaldmg, Color.magenta, GameFont.Medium);
                }
                else
                {
                    WarframeStaticMethods.ShowDamageAmount(hitThing, finaldmg + "");
                }

                hitThing.TakeDamage(dinfo).AssociateWithLog(battleLogEntry_RangedImpact);
                if (hitThing is Pawn {
                    stances : { }
                } pawn&& pawn.BodySize <= def.projectile.StoppingPower + 0.001f)
                {
                    pawn.stances.StaggerFor(95);
                }
            }
            else
            {
                SoundDefOf.BulletImpact_Ground.PlayOneShot(new TargetInfo(Position, map));
                FleckMaker.Static(ExactPosition, map, FleckDefOf.ShotHit_Dirt);
                if (Position.GetTerrain(map).takeSplashes)
                {
                    FleckMaker.WaterSplash(ExactPosition, map, Mathf.Sqrt(DamageAmount) * 1f, 4f);
                }
            }
        }
Example #5
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);
        }