public void OnBombed(Bombardment instigator) { if (NumHeldItems <= 0) { CharacterMovement movementComponent = GetComponent <CharacterMovement> (); if (movementComponent != null) { movementComponent.Stun(); } } }
public void OnBombed(Bombardment instigator) { if (_holdState == HoldState.Held) { Debug.LogFormat("Bomb dropped {0} from the player's hand", gameObject.name); // Drop if held GameManager.Instance.interactionComponent.InventoryComponent.DropHeld(this); } else if (_holdState == HoldState.Dropped) { Debug.LogFormat("Bomb destroyed {0} from the ground", gameObject.name); // Destroy if on the ground gameObject.SetActive(false); } }
public override bool StartSpecialSkill(Cooldown sk) { if (Balder.Skill != null && sk.Skill.IconName == Balder.Skill.IconName) { Balder.Start(sk.Duration); return(true); } if (Bombardment.Skill != null && sk.Skill.IconName == Bombardment.Skill.IconName) { Bombardment.Start(sk.Duration); return(true); } if (ModularSystem.Cooldown.Skill != null && sk.Skill.IconName == ModularSystem.Cooldown.Skill.IconName) { ModularSystem.Cooldown.Start(sk.Duration); return(true); } return(false); }
public override void Execute(int amount, string boughtBy) { Map currentMap = Find.CurrentMap; CellRect cellRect = CellRect.WholeMap(currentMap).ContractedBy(30); if (cellRect.IsEmpty) { cellRect = CellRect.WholeMap(currentMap); } IntVec3 location; if (CellFinder.TryFindRandomCellInsideWith(cellRect, (IntVec3 x) => true, out location)) { Bombardment bombardment = (Bombardment)GenSpawn.Spawn(ThingDefOf.Bombardment, location, currentMap); bombardment.StartStrike(); AlertManager.BadEventNotification("A bombardment from space", location); } }
static void Postfix(Bombardment __instance) { RegionTraverser.BreadthFirstTraverse(__instance.Position, __instance.Map, (from, to) => true, region => { region.ListerThings.ThingsInGroup(ThingRequestGroup.Pawn) .Select(p => (Pawn)p) .Where(p => !p.Downed && !p.Dead && !p.Drafted) .Where(p => p.CurJobDef != JobDefOf.Flee && !p.Downed) .Where(p => p.Position.DistanceTo(__instance.Position) <= 24.0f) .ToList() .ForEach(pawn => { var threats = new List <Thing> { __instance }; var fleeDest1 = CellFinderLoose.GetFleeDest(pawn, threats, pawn.Position.DistanceTo(__instance.Position) + Bombardment.EffectiveRadius); pawn.jobs.StartJob(new Job(JobDefOf.Flee, fleeDest1, (LocalTargetInfo)__instance), JobCondition.InterruptOptional, null, false, true, null, new JobTag?()); }); return(false); }, 25, RegionType.Set_All); }
public override void Dispose() { Bombardment.Dispose(); Balder.Dispose(); ModularSystem.Dispose(); }
static bool Prefix(ref Bombardment __instance) { __instance.bombIntervalTicks /= RefcellRespeedConfig.currentTimeMultiplier; __instance.explosionCount *= RefcellRespeedConfig.currentTimeMultiplier; return(true); }
public void OnBombed(Bombardment instigator) { Debug.LogFormat("Bombed {0} for {1} damage", gameObject.name, instigator.damage); ChangeHealth(-instigator.damage); }