// Token: 0x06007CE5 RID: 31973 RVA: 0x00316054 File Offset: 0x00314254 public void Interact(PlayerController interactor) { if (!PassiveItem.IsFlagSetAtAll(typeof(CatchingMitts)) || base.projectile == null) { return; } PlayerController player = GameManager.Instance.PrimaryPlayer; CatchingMitts.cooldownBehavior cooldownBehavior = player.GetComponent <CatchingMitts.cooldownBehavior>(); if (cooldownBehavior.parentItem.cooldown > 0.25f) { base.projectile.DieInAir(false, true, true, false); this.m_room.DeregisterInteractable(this); SpriteOutlineManager.RemoveOutlineFromSprite(base.sprite, false); if (player.PlayerHasActiveSynergy("Shortstop")) { player.CurrentGun.GainAmmo(1); } else if (UnityEngine.Random.value <= 0.5f) { player.CurrentGun.GainAmmo(1); } cooldownBehavior.parentItem.cooldown = 0f; } }
private void TakeItem(PlayerController player) { if (PickupObjectDatabase.GetById(ItemID) && (PickupObjectDatabase.GetById(ItemID).sprite as tk2dSprite) != null && player.HasPassiveItem(ItemID)) { m_Interacted = true; } else { return; } GameObject m_SubSpriteObject = new GameObject("Item Display Object", new Type[] { typeof(tk2dSprite) }) { layer = 0 }; m_SubSpriteObject.transform.position = (transform.position + new Vector3(0.35f, 1.3f)); ExpandUtility.DuplicateSprite(m_SubSpriteObject.GetComponent <tk2dSprite>(), (PickupObjectDatabase.GetById(ItemID).sprite as tk2dSprite)); if (m_ParentRoom != null) { m_SubSpriteObject.transform.parent = m_ParentRoom.hierarchyParent; } m_SubSpriteObject.GetComponent <tk2dSprite>().HeightOffGround = 3f; m_SubSpriteObject.GetComponent <tk2dSprite>().UpdateZDepth(); player.RemovePassiveItem(ItemID); if (m_TargetDoor && m_TargetDoor.GetComponent <tk2dSpriteAnimator>() && m_TargetDoor.GetComponent <SpeculativeRigidbody>()) { AkSoundEngine.PostEvent("Play_OBJ_plate_press_01", gameObject); StartCoroutine(DelayedDoorOpen(m_TargetDoor)); } SpriteOutlineManager.RemoveOutlineFromSprite(sprite, false); }
public void Interact(PlayerController interactor) { //custom mount sfx here //mounting if (isOnTurret == false && !interactor.IsDodgeRolling) { isOnTurret = true; AkSoundEngine.PostEvent("Play_tur_mount", base.gameObject); AkSoundEngine.PostEvent("Play_tur_mount", base.gameObject); AkSoundEngine.PostEvent("Play_tur_mount", base.gameObject); AkSoundEngine.PostEvent("Play_tur_mount", base.gameObject); interactor.specRigidbody.Position = new Position(base.sprite.WorldCenter - new Vector2(.7f, 0.3f)); SpriteOutlineManager.RemoveOutlineFromSprite(base.sprite, false); SpriteOutlineManager.AddOutlineToSprite(base.sprite, Color.black); } else { isOnTurret = false; SpriteOutlineManager.RemoveOutlineFromSprite(base.sprite, false); SpriteOutlineManager.AddOutlineToSprite(base.sprite, Color.white); } //remove movement //sprun-like gunswap }
public void OnExitRange(PlayerController player) { if (base.sprite != null) { SpriteOutlineManager.RemoveOutlineFromSprite(base.sprite); } }
public void Interact(PlayerController interactor) { try { if (!this) { return; } if (interactor.CurrentItem) { if (RoomHandler.unassignedInteractableObjects.Contains(this)) { RoomHandler.unassignedInteractableObjects.Remove(this); } SpriteOutlineManager.RemoveOutlineFromSprite(base.sprite, true); this.Pickup(interactor); } else { } } catch (Exception err) { ETGModConsole.Log("Risky ammo bugged! Yell at me or Ski!" + err.ToString(), true); } }
private static void OnPlayerCharacterChanged(PlayerController player, FoyerCharacterSelectFlag selectCharacter, string characterPath) { if (player.name.ToLower().Contains(characterPath)) { ToolsCharApi.Print("Selected: " + characterPath); if (selectCharacter.gameObject.activeSelf) { selectCharacter.ClearOverheadElement(); selectCharacter.talkDoer.OnExitRange(null); selectCharacter.gameObject.SetActive(false); selectCharacter.GetComponent <SpeculativeRigidbody>().enabled = false; } } else if (!selectCharacter.gameObject.activeSelf) { selectCharacter.gameObject.SetActive(true); SpriteOutlineManager.RemoveOutlineFromSprite(selectCharacter.sprite, true); SpriteOutlineManager.AddOutlineToSprite(selectCharacter.sprite, Color.black); selectCharacter.specRigidbody.enabled = true; PhysicsEngine.Instance.RegisterOverlappingGhostCollisionExceptions(selectCharacter.specRigidbody, null, false); CharacterSelectIdleDoer idleDoer = selectCharacter.GetComponent <CharacterSelectIdleDoer>(); idleDoer.enabled = true; } }
// Token: 0x06007CE3 RID: 31971 RVA: 0x0026DAFF File Offset: 0x0026BCFF public void OnEnteredRange(PlayerController interactor) { if (!PassiveItem.IsFlagSetAtAll(typeof(LootersGloves))) { return; } SpriteOutlineManager.RemoveOutlineFromSprite(base.sprite, true); SpriteOutlineManager.AddOutlineToSprite(base.sprite, Color.white); }
// Token: 0x06007CE4 RID: 31972 RVA: 0x00316033 File Offset: 0x00314233 public void OnExitRange(PlayerController interactor) { if (!PassiveItem.IsFlagSetAtAll(typeof(PickpocketGuide))) { return; } SpriteOutlineManager.RemoveOutlineFromSprite(base.sprite, true); SpriteOutlineManager.AddOutlineToSprite(base.sprite, Color.black); }
private static void ResetToIdle(BraveBehaviour idler) { SpriteOutlineManager.RemoveOutlineFromSprite(idler.sprite, true); SpriteOutlineManager.AddOutlineToSprite(idler.sprite, Color.black); //var idle = idler.GetComponent<CharacterSelectIdleDoer>().coreIdleAnimation; //idler.sprite.SetSprite(idler.spriteAnimator.GetClipByName(idle).frames[0].spriteId); //idler.talkDoer.OnExitRange(null); }
public void OnExitRange(PlayerController interactor) { if (!this) { return; } SpriteOutlineManager.RemoveOutlineFromSprite(sprite, false); sprite.UpdateZDepth(); }
public void OnExitRange(PlayerController interactor) { if (!this | m_Interacted | ItemID == -1 | !interactor | !interactor.HasPassiveItem(ItemID) | m_TargetRoom == null) { return; } SpriteOutlineManager.RemoveOutlineFromSprite(sprite, false); sprite.UpdateZDepth(); }
// Token: 0x06007CE4 RID: 31972 RVA: 0x00316033 File Offset: 0x00314233 public void OnExitRange(PlayerController interactor) { if (!PassiveItem.IsFlagSetAtAll(typeof(CatchingMitts)) || !base.sprite || !base.projectile) { return; } SpriteOutlineManager.RemoveOutlineFromSprite(base.sprite, true); SpriteOutlineManager.AddOutlineToSprite(base.sprite, Color.black); }
public void Update() { if (m_WasKicked) { if (GetAbsoluteParentRoom() == null) { m_WasKicked = false; willDefinitelyExplode = true; SelfDestructOnKick(); } FlippableCover m_Table = GetComponent <FlippableCover>(); if (m_Table) { if (m_Table.IsBroken) { m_WasKicked = false; willDefinitelyExplode = true; SelfDestructOnKick(); } } } if (m_shouldDisplayOutline) { int num; DungeonData.Direction inverseDirection = DungeonData.GetInverseDirection(DungeonData.GetDirectionFromIntVector2(GetFlipDirection(m_lastInteractingPlayer.specRigidbody, out num))); if (inverseDirection != m_lastOutlineDirection || sprite.spriteId != m_lastSpriteId) { SpriteOutlineManager.RemoveOutlineFromSprite(sprite, false); SpriteOutlineManager.AddSingleOutlineToSprite <tk2dSprite>(sprite, DungeonData.GetIntVector2FromDirection(inverseDirection), Color.white, 0.25f, 0f); } m_lastOutlineDirection = inverseDirection; m_lastSpriteId = sprite.spriteId; } if (leavesGoopTrail && specRigidbody.Velocity.magnitude > 0.1f) { m_goopElapsed += BraveTime.DeltaTime; if (m_goopElapsed > goopFrequency) { m_goopElapsed -= BraveTime.DeltaTime; if (m_goopManager == null) { m_goopManager = DeadlyDeadlyGoopManager.GetGoopManagerForGoopType(goopType); } m_goopManager.AddGoopCircle(sprite.WorldCenter, goopRadius + 0.1f, -1, false, -1); } if (AllowTopWallTraversal && GameManager.Instance.Dungeon.data.CheckInBoundsAndValid(sprite.WorldCenter.ToIntVector2(VectorConversions.Floor)) && GameManager.Instance.Dungeon.data[sprite.WorldCenter.ToIntVector2(VectorConversions.Floor)].IsFireplaceCell) { MinorBreakable component = GetComponent <MinorBreakable>(); if (component && !component.IsBroken) { component.Break(Vector2.zero); GameStatsManager.Instance.SetFlag(GungeonFlags.FLAG_ROLLED_BARREL_INTO_FIREPLACE, true); } } } }
public new void OnEnteredRange(PlayerController interactor) { if (!this) { return; } SpriteOutlineManager.RemoveOutlineFromSprite(base.sprite, false); SpriteOutlineManager.AddOutlineToSprite(base.sprite, Color.white); Vector3 offset = new Vector3(base.sprite.GetBounds().max.x + 0.1875f, base.sprite.GetBounds().min.y, 0f); EncounterTrackable component = this.item.GetComponent <EncounterTrackable>(); string arg = (!(component != null)) ? this.item.DisplayName : component.journalData.GetPrimaryDisplayName(false); string text = this.ModifiedPrice.ToString(); if (this.m_baseParentShop != null) { if (this.CurrencyType == CustomShopItemController.ShopCurrencyType.META_CURRENCY) { text += "[sprite \"hbux_text_icon\"]"; } else if (this.CurrencyType == CustomShopItemController.ShopCurrencyType.COINS) { text += "[sprite \"ui_coin\"]"; } else if (this.CurrencyType == CustomShopItemController.ShopCurrencyType.KEYS) { text += "[sprite \"ui_key\"]"; } else if (this.CurrencyType == CustomShopItemController.ShopCurrencyType.BLANKS) { text += "[sprite \"ui_blank\"]"; } else if (this.CurrencyType == CustomShopItemController.ShopCurrencyType.CUSTOM) { text += "[sprite \"" + customPriceSprite + "\"]"; } else { text += "[sprite \"ui_coin\"]"; } } string text2; if ((this.m_baseParentShop && (this.m_baseParentShop.IsCapableOfBeingStolenFrom) || interactor.IsCapableOfStealing) && this.m_baseParentShop.canBeRobbed) { text2 = string.Format("[color red]{0}: {1} {2}[/color]", arg, text, StringTableManager.GetString("#STEAL")); } else { text2 = string.Format("{0}: {1}", arg, text); } GameObject gameObject = GameUIRoot.Instance.RegisterDefaultLabel(base.transform, offset, text2); dfLabel componentInChildren = gameObject.GetComponentInChildren <dfLabel>(); componentInChildren.ColorizeSymbols = false; componentInChildren.ProcessMarkup = true; }
public void OnEnteredRange(PlayerController interactor) { if (!this) { return; } SpriteOutlineManager.RemoveOutlineFromSprite(sprite, false); SpriteOutlineManager.AddOutlineToSprite(sprite, Color.white, 0.1f, 0f, SpriteOutlineManager.OutlineType.NORMAL); sprite.UpdateZDepth(); }
public new void OnExitRange(PlayerController interactor) { if (!this) { return; } SpriteOutlineManager.RemoveOutlineFromSprite(base.sprite, false); SpriteOutlineManager.AddOutlineToSprite(base.sprite, Color.black, 0.1f, 0.05f, SpriteOutlineManager.OutlineType.NORMAL); GameUIRoot.Instance.DeregisterDefaultLabel(base.transform); }
public void OnEnteredRange(PlayerController interactor) { if (!this | m_InUse | m_IsRecievingPlayer | m_WaitingForPlayer | m_IsLocked | m_Disabled) { return; } SpriteOutlineManager.RemoveOutlineFromSprite(m_doorLightSprite, false); SpriteOutlineManager.AddOutlineToSprite(m_doorLightSprite, Color.white, 0.1f, 0f, SpriteOutlineManager.OutlineType.NORMAL); m_doorLightSprite.UpdateZDepth(); }
public void OnExitRange(PlayerController interactor) { if (!this) { return; } SpriteOutlineManager.RemoveOutlineFromSprite(m_doorLightSprite, false); SpriteOutlineManager.AddOutlineToSprite(m_doorLightSprite, Color.black, 0.1f, 0f, SpriteOutlineManager.OutlineType.NORMAL); m_doorLightSprite.UpdateZDepth(); }
public void OnExitRange(PlayerController interactor) { if (!this) { return; } SpriteOutlineManager.RemoveOutlineFromSprite(base.sprite, true); SpriteOutlineManager.AddOutlineToSprite(base.sprite, Color.black, 0.1f); base.sprite.UpdateZDepth(); }
public void OnExitRange(PlayerController player) { if (base.sprite != null) { if (SpriteOutlineManager.HasOutline(base.sprite)) { SpriteOutlineManager.RemoveOutlineFromSprite(base.sprite); } SpriteOutlineManager.AddOutlineToSprite(base.sprite, Color.black); } }
public void OnEnteredRange(PlayerController interactor) { if (!this) { return; } if (!interactor.CurrentRoom.IsRegistered(this) && !RoomHandler.unassignedInteractableObjects.Contains(this)) { return; } SpriteOutlineManager.RemoveOutlineFromSprite(base.sprite, false); SpriteOutlineManager.AddOutlineToSprite(base.sprite, Color.white, 0.1f, 0f, SpriteOutlineManager.OutlineType.NORMAL); base.sprite.UpdateZDepth(); }
public void OnExitRange(PlayerController interactor) { if (!this) { return; } if (m_boxIsExtant) { ClearBox(); } SpriteOutlineManager.RemoveOutlineFromSprite(sprite, true); SpriteOutlineManager.AddOutlineToSprite(sprite, Color.black, 0.1f, 0f, SpriteOutlineManager.OutlineType.NORMAL); sprite.UpdateZDepth(); }
private void OnPreCollision(SpeculativeRigidbody otherRigidbody, SpeculativeRigidbody source, CollisionData collisionData) { if (this.m_hasBeenPickedUp) { return; } PlayerController component = otherRigidbody.GetComponent <PlayerController>(); if (component != null) { this.m_hasBeenPickedUp = true; SpriteOutlineManager.RemoveOutlineFromSprite(base.sprite, true); this.Pickup(component); } }
public void OnExitRange(PlayerController interactor) { if (!this) { return; } if (m_itemDisplaySprite) { SpriteOutlineManager.RemoveOutlineFromSprite(m_itemDisplaySprite, true); if (AddOutline) { SpriteOutlineManager.AddOutlineToSprite(m_itemDisplaySprite, BaseOutlineColor, 0.1f, 0f, SpriteOutlineManager.OutlineType.NORMAL); } sprite.UpdateZDepth(); } }
public void Interact(PlayerController interactor) { if (!this) { return; } if (interactor && interactor.carriedConsumables.KeyBullets <= 0 && !interactor.carriedConsumables.InfiniteKeys) { return; } if (RoomHandler.unassignedInteractableObjects.Contains(this)) { RoomHandler.unassignedInteractableObjects.Remove(this); } SpriteOutlineManager.RemoveOutlineFromSprite(base.sprite, true); this.Pickup(interactor); }
public static void ammoInteractHookMethod(Action <AmmoPickup, PlayerController> orig, AmmoPickup self, PlayerController player) { if (player.CurrentGun && OverrideNoCheckIDs.Contains(player.CurrentGun.PickupObjectId)) { if (RoomHandler.unassignedInteractableObjects.Contains(self)) { RoomHandler.unassignedInteractableObjects.Remove(self); } SpriteOutlineManager.RemoveOutlineFromSprite(self.sprite, true); self.Pickup(player); } else if (player.CurrentGun && !player.CurrentGun.CanGainAmmo) { GameUIRoot.Instance.InformNeedsReload(player, new Vector3(player.specRigidbody.UnitCenter.x - player.transform.position.x, 1.25f, 0f), 1f, "#RELOAD_FULL"); return; } else { orig(self, player); } }
public void Interact(PlayerController interactor) { if (!this) { return; } if (interactor.CurrentGun == null || interactor.CurrentGun.ammo == interactor.CurrentGun.AdjustedMaxAmmo || interactor.CurrentGun.InfiniteAmmo || interactor.CurrentGun.RequiresFundsToShoot) { if (interactor.CurrentGun != null) { GameUIRoot.Instance.InformNeedsReload(interactor, new Vector3(interactor.specRigidbody.UnitCenter.x - interactor.transform.position.x, 1.25f, 0f), 1f, "#RELOAD_FULL"); } return; } if (RoomHandler.unassignedInteractableObjects.Contains(this)) { RoomHandler.unassignedInteractableObjects.Remove(this); } SpriteOutlineManager.RemoveOutlineFromSprite(base.sprite, true); this.Pickup(interactor); }
// Token: 0x06007CE5 RID: 31973 RVA: 0x00316054 File Offset: 0x00314254 public void Interact(PlayerController interactor) { if (!PassiveItem.IsFlagSetAtAll(typeof(LootersGloves))) { return; } FloorRewardData currentRewardData = GameManager.Instance.RewardManager.CurrentRewardData; LootEngine.AmmoDropType ammoDropType = LootEngine.AmmoDropType.DEFAULT_AMMO; bool flag = LootEngine.DoAmmoClipCheck(currentRewardData, out ammoDropType); string path = (ammoDropType != LootEngine.AmmoDropType.SPREAD_AMMO) ? "Ammo_Pickup" : "Ammo_Pickup_Spread"; float value = UnityEngine.Random.value; float num = currentRewardData.ChestSystem_ChestChanceLowerBound; if (value <= 0.2f) { IntVector2 bestRewardLocation = base.sprite.WorldCenter.ToIntVector2(); LootEngine.SpawnItem((GameObject)BraveResources.Load(path, ".prefab"), bestRewardLocation.ToVector3(), Vector2.up, 1f, true, true, false); } else if (value <= 0.9f) { GameObject gameObject; if(value <= 0.55f) { gameObject = currentRewardData.SingleItemRewardTable.SelectByWeight(false); } else { gameObject = ((UnityEngine.Random.value >= 0.9f) ? GameManager.Instance.RewardManager.FullHeartPrefab.gameObject : GameManager.Instance.RewardManager.HalfHeartPrefab.gameObject); } DebrisObject debrisObject = LootEngine.SpawnItem(gameObject, base.sprite.WorldCenter.ToIntVector2().ToVector3() + new Vector3(0.25f, 0f, 0f), Vector2.up, 1f, true, true, false); AkSoundEngine.PostEvent("Play_OBJ_item_spawn_01", debrisObject.gameObject); } else { GameManager.Instance.RewardManager.SpawnTotallyRandomItem(base.sprite.WorldCenter); } this.m_room.DeregisterInteractable(this); SpriteOutlineManager.RemoveOutlineFromSprite(base.sprite, false); UnityEngine.Object.Destroy(base.gameObject); }
private void ClearOutlines() { m_lastOutlineDirection = (DungeonData.Direction)(-1); m_lastSpriteId = -1; SpriteOutlineManager.RemoveOutlineFromSprite(sprite, false); }
public void OnExitRange(PlayerController interactor) { SpriteOutlineManager.RemoveOutlineFromSprite(base.sprite, false); }