//咖喱技能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); }
//咖喱4结束action public static void EndSkill4(Pawn self) { SoundDef.Named("Excalibur_ExaltedBladeOff").PlayOneShot(self); var wa = WarframeStaticMethods.GetArmor(self); self.equipment.Remove(self.equipment.Primary); //.Primary.Destroy(DestroyMode.Vanish); ThingWithComps gun = null; try { // gun = WFModBase.Instance._WFcontrolstorage.getOldGun(self); gun = wa.oldWeapon[0]; } catch (Exception) { // Log.Warning("gun is null"); } // WFModBase.Instance._WFcontrolstorage.clearWFandOG(self); wa.oldWeapon.Clear(); if (gun != null) { self.equipment.AddEquipment(gun); } wa.tillSkillOpen = 0; wa.tillSkillMul = 1; }
//咖喱技能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); }
//咖喱技能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); }
//咖喱技能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); }
//咖喱技能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); }
//咖喱技能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); }
//咖喱技能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); }
//咖喱4结束action public static void EndSkill4(Pawn self) { SoundDef.Named("Valkyr_4SkillEnd").PlayOneShot(self); var wa = WarframeStaticMethods.GetArmor(self); self.equipment.Remove(self.equipment.Primary); //.Primary.Destroy(DestroyMode.Vanish); ThingWithComps gun = null; try { // gun = WFModBase.Instance._WFcontrolstorage.getOldGun(self); gun = wa.oldWeapon[0]; } catch (Exception) { // Log.Warning("gun is null"); } // WFModBase.Instance._WFcontrolstorage.clearWFandOG(self); wa.oldWeapon.Clear(); if (gun != null) { self.equipment.AddEquipment(gun); } wa.tillSkillOpen = 0; wa.tillSkillMul = 1; foreach (var hef in self.health.hediffSet.hediffs) { if (hef.def.defName != "WFGod") { continue; } self.health.RemoveHediff(hef); break; } }
//咖喱技能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); }
//咖喱技能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); }
//咖喱技能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); }
//咖喱技能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); }
//咖喱技能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); }
//咖喱技能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); }
//咖喱技能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); }
//咖喱技能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); }
//咖喱技能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); }
//咖喱技能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); }