public override void OnPickup(ItemPedestal pedestal, PlayerController player) { base.OnPickup(pedestal, player); player.maxHealth += 2; player.health += 2; player.damage *= 1.25f; }
public void PickUpItem(ItemPedestal pedestal, Item item) { if (item.IsActive) { pedestal.item = activeItem; activeItem = item as ActiveItem; if (pedestal.item != null) { pedestal.item.transform.SetParent(pedestal.itemParent, false); pedestal.item.GetComponent <SpriteRenderer>().enabled = true; } } else { items.Add(item); pedestal.item = null; } item.transform.SetParent(transform, false); item.transform.position = transform.position; item.transform.localScale = Vector3.one; item.GetComponent <SpriteRenderer>().enabled = false; Debug.Log("hej: " + item.itemName); lastItem = item; StopCoroutine("ShowItemInfo"); StartCoroutine("ShowItemInfo"); UpdateUI(); }
public override void OnPickup(ItemPedestal pedestal, PlayerController player) { base.OnPickup(pedestal, player); player.hasThorn = true; player.Thornprefab = projectilePrefab; player.damage *= 1.25f; }
public override void OnPickup(ItemPedestal pedestal, PlayerController player) { base.OnPickup(pedestal, player); player.damage *= 1.25f; player.speed *= 1.25f; player.acceleration *= 1.25f; }
public override void OnPickup(ItemPedestal pedestal, PlayerController player) { base.OnPickup(pedestal, player); player.maxHealth += 4; player.health += 4; player.UpdateUI(); }
public override void OnPickup(ItemPedestal pedestal, PlayerController player) { base.OnPickup(pedestal, player); player.hasBensGrill = true; player.Coalprefab = projectilePrefab1; player.BBQprefab = projectilePrefab2; }
public override void OnPickup(ItemPedestal pedestal, PlayerController player) { base.OnPickup(pedestal, player); player.damage *= 1.3f; player.fireDelay *= 0.8f; player.hasFireFlower = true; player.Fireprefab = projectilePrefab; }
public override void OnPickup(ItemPedestal pedestal, PlayerController player) { base.OnPickup(pedestal, player); player.maxHealth += 2; player.health += 2; player.fireDelay *= 0.8f; player.speed *= 0.8f; player.accuracy *= 2f; player.UpdateUI(); }
public override void TransferDataFromSavedLocation(GameLocation l) { base.TransferDataFromSavedLocation(l); if (l is IslandShrine) { IslandShrine shrine = l as IslandShrine; northPedestal = (shrine.getObjectAtTile((int)northPedestal.TileLocation.X, (int)northPedestal.TileLocation.Y) as ItemPedestal); southPedestal = (shrine.getObjectAtTile((int)southPedestal.TileLocation.X, (int)southPedestal.TileLocation.Y) as ItemPedestal); eastPedestal = (shrine.getObjectAtTile((int)eastPedestal.TileLocation.X, (int)eastPedestal.TileLocation.Y) as ItemPedestal); westPedestal = (shrine.getObjectAtTile((int)westPedestal.TileLocation.X, (int)westPedestal.TileLocation.Y) as ItemPedestal); puzzleFinished.Value = shrine.puzzleFinished.Value; } }
internal void OnOneSecondUpdateTicked(object sender, OneSecondUpdateTickedEventArgs e) { if (!Context.IsWorldReady || !Game1.player.IsMainPlayer) { return; } else if (StartedOpeningEvent) { return; } try { GameLocation location = Game1.getLocationFromName("Custom_Ridgeside_RidgeFalls"); bool all_done = true; foreach (var pedestal in PedestalTemplates) { ItemPedestal itemPedestal = (ItemPedestal)location.Objects[pedestal.tilePosition]; if (!itemPedestal.match.Value) { all_done = false; break; } } if (all_done) { //check if we can start the event if (Game1.eventUp || Game1.currentLocation.currentEvent != null || Game1.farmEvent != null || !StardewModdingAPI.Context.CanPlayerMove || Game1.IsFading()) { return; } foreach (var pedestal in PedestalTemplates) { ItemPedestal itemPedestal = (ItemPedestal)location.Objects[pedestal.tilePosition]; itemPedestal.locked.Value = true; } StartedOpeningEvent = true; Helper.Events.GameLoop.OneSecondUpdateTicked -= OnOneSecondUpdateTicked; var Events = location.GetLocationEvents(); var PortalEvent = new Event(Events["75160256/n InexistentMailFlag"], eventID: 75160256); // Moved add special order command to UntimedSO UtilFunctions.StartEvent(PortalEvent, "Custom_Ridgeside_RidgeFalls", 15, 43); } } catch (Exception exception) { Log.Warn("Issue with pedestals detected in OneSecondUpdate. Check Trace for Details"); Log.Trace(exception.Message); Log.Trace(exception.StackTrace); Helper.Events.GameLoop.OneSecondUpdateTicked -= OnOneSecondUpdateTicked; } }
internal void OpenPortal(string arg1, string[] arg2) { if (!Game1.IsMasterGame) { return; } GameLocation location = Game1.getLocationFromName("Custom_Ridgeside_RidgeFalls"); foreach (var pedestalTemplate in PedestalTemplates) { ItemPedestal pedestal = (ItemPedestal)location.Objects[pedestalTemplate.tilePosition]; pedestal.heldObject.Value = (SObject)pedestal.requiredItem.Value.getOne(); pedestal.UpdateItemMatch(); } }
public override void OnPickup(ItemPedestal pedestal, PlayerController player) { base.OnPickup(pedestal, player); player.maxHealth += 2; player.health += 2; player.damage *= 1.25f; player.fireDelay *= 0.8f; player.shotTimer *= 1.25f; player.shotSpeed *= 1.25f; player.accuracy *= 0.8f; player.speed *= 1.25f; player.acceleration *= 1.25f; player.invincibilityOnDamage *= 1.25f; player.UpdateUI(); }
public override bool Use(PlayerController player) { if (base.Use(player)) { foreach (DungeonObject dungeonObject in player.currentRoom.contents.objects) { ItemPedestal itemPedestal = dungeonObject as ItemPedestal; if (itemPedestal != null && itemPedestal.item != null) { Destroy(itemPedestal.item.gameObject); itemPedestal.item = Instantiate <Item>(itemPedestal.pool.GetRandomItem(), itemPedestal.itemParent); } } return(true); } else { return(false); } }
public override bool Use(PlayerController player) { if (base.Use(player)) { foreach (DungeonObject dungeonObject in player.currentRoom.contents.objects) { ItemPedestal itemPedestal = dungeonObject as ItemPedestal; if (itemPedestal != null && itemPedestal.item != null) { Destroy(itemPedestal.item.gameObject); if (Random.Range(0, 101) > 99) { itemPedestal.item = Instantiate <Item>(itemPedestal.pool.GetRandomItem(), itemPedestal.itemParent); } player.keyCount += Random.Range(-2, 3); player.bombCount += Random.Range(-2, 3); player.maxHealth += Random.Range(-1, 2); player.health += Random.Range(-2, 3); player.damage *= Random.Range(0.85f, 1.5f); player.fireDelay *= Random.Range(0.75f, 1.3f); player.shotTimer *= Random.Range(0.85f, 1.5f); player.shotSpeed *= Random.Range(0.85f, 1.5f); player.accuracy *= Random.Range(0.75f, 1.3f); player.speed *= Random.Range(0.85f, 1.5f); player.acceleration *= Random.Range(0.85f, 1.5f); player.invincibilityOnDamage *= Random.Range(0.85f, 1.5f); player.UpdateUI(); } } return(true); } else { return(false); } }
private void AddMissingPedestals() { Log.Trace("Adding pedestals"); GameLocation location = Game1.getLocationFromName("Custom_Ridgeside_RidgeFalls"); foreach (var pedestal in PedestalTemplates) { location.Objects.TryGetValue(pedestal.tilePosition, out SObject existing_object); if (existing_object != null && !(existing_object is ItemPedestal)) { location.Objects.Remove(pedestal.tilePosition); } else if (existing_object == null) { location.Objects.Add(pedestal.tilePosition, new ItemPedestal(pedestal.tilePosition, new SObject(ExternalAPIs.JA.GetObjectId(pedestal.RequiredItemName), 1), false, Color.White)); } } try { foreach (var pedestal in PedestalTemplates) { ItemPedestal itemPedestal = (ItemPedestal)location.Objects[pedestal.tilePosition]; itemPedestal.requiredItem.Value = new SObject(ExternalAPIs.JA.GetObjectId(pedestal.RequiredItemName), 1); itemPedestal.lockOnSuccess.Value = false; itemPedestal.UpdateItemMatch(); } } catch (Exception exception) { Log.Warn("Issue with pedestals detected in AddMissingPedestals. Check Trace for Details"); Log.Trace(exception.Message); Log.Trace(exception.StackTrace); } }
public override void OnPickup(ItemPedestal pedestal, PlayerController player) { base.OnPickup(pedestal, player); player.accuracy = 0; player.shotSpeed = 30; }
public override void OnPickup(ItemPedestal pedestal, PlayerController player) { base.OnPickup(pedestal, player); player.hasLibPolicy = true; }
public virtual void AddMissingPedestals() { Vector2 position = new Vector2(0f, 0f); position.X = 21f; position.Y = 27f; IslandGemBird.GemBirdType bird_type5 = IslandGemBird.GemBirdType.Amethyst; Object existing_pedestal4 = getObjectAtTile((int)position.X, (int)position.Y); bird_type5 = IslandGemBird.GetBirdTypeForLocation("IslandWest"); if (existing_pedestal4 == null) { westPedestal = new ItemPedestal(position, null, lock_on_success: false, Color.White); objects.Add(position, westPedestal); westPedestal.requiredItem.Value = new Object(Vector2.Zero, IslandGemBird.GetItemIndex(bird_type5), 1); westPedestal.successColor.Value = new Color(0, 0, 0, 0); } else if (existing_pedestal4 is ItemPedestal) { ItemPedestal pedestal4 = existing_pedestal4 as ItemPedestal; int item_index4 = IslandGemBird.GetItemIndex(bird_type5); if (pedestal4.requiredItem.Value == null || pedestal4.requiredItem.Value.ParentSheetIndex != item_index4) { pedestal4.requiredItem.Value = new Object(Vector2.Zero, item_index4, 1); if (pedestal4.heldObject.Value != null && pedestal4.heldObject.Value.ParentSheetIndex != item_index4) { pedestal4.heldObject.Value = null; } } } position.X = 27f; position.Y = 27f; existing_pedestal4 = getObjectAtTile((int)position.X, (int)position.Y); bird_type5 = IslandGemBird.GetBirdTypeForLocation("IslandEast"); if (existing_pedestal4 == null) { eastPedestal = new ItemPedestal(position, null, lock_on_success: false, Color.White); objects.Add(position, eastPedestal); eastPedestal.requiredItem.Value = new Object(Vector2.Zero, IslandGemBird.GetItemIndex(bird_type5), 1); eastPedestal.successColor.Value = new Color(0, 0, 0, 0); } else if (existing_pedestal4 is ItemPedestal) { ItemPedestal pedestal3 = existing_pedestal4 as ItemPedestal; int item_index3 = IslandGemBird.GetItemIndex(bird_type5); if (pedestal3.requiredItem.Value == null || pedestal3.requiredItem.Value.ParentSheetIndex != item_index3) { pedestal3.requiredItem.Value = new Object(Vector2.Zero, item_index3, 1); if (pedestal3.heldObject.Value != null && pedestal3.heldObject.Value.ParentSheetIndex != item_index3) { pedestal3.heldObject.Value = null; } } } position.X = 24f; position.Y = 28f; existing_pedestal4 = getObjectAtTile((int)position.X, (int)position.Y); bird_type5 = IslandGemBird.GetBirdTypeForLocation("IslandSouth"); if (existing_pedestal4 == null) { southPedestal = new ItemPedestal(position, null, lock_on_success: false, Color.White); objects.Add(position, southPedestal); southPedestal.requiredItem.Value = new Object(Vector2.Zero, IslandGemBird.GetItemIndex(bird_type5), 1); southPedestal.successColor.Value = new Color(0, 0, 0, 0); } else if (existing_pedestal4 is ItemPedestal) { ItemPedestal pedestal2 = existing_pedestal4 as ItemPedestal; int item_index2 = IslandGemBird.GetItemIndex(bird_type5); if (pedestal2.requiredItem.Value == null || pedestal2.requiredItem.Value.ParentSheetIndex != item_index2) { pedestal2.requiredItem.Value = new Object(Vector2.Zero, item_index2, 1); if (pedestal2.heldObject.Value != null && pedestal2.heldObject.Value.ParentSheetIndex != item_index2) { pedestal2.heldObject.Value = null; } } } position.X = 24f; position.Y = 25f; existing_pedestal4 = getObjectAtTile((int)position.X, (int)position.Y); bird_type5 = IslandGemBird.GetBirdTypeForLocation("IslandNorth"); if (existing_pedestal4 == null) { northPedestal = new ItemPedestal(position, null, lock_on_success: false, Color.White); objects.Add(position, northPedestal); northPedestal.requiredItem.Value = new Object(Vector2.Zero, IslandGemBird.GetItemIndex(bird_type5), 1); northPedestal.successColor.Value = new Color(0, 0, 0, 0); } else { if (!(existing_pedestal4 is ItemPedestal)) { return; } ItemPedestal pedestal = existing_pedestal4 as ItemPedestal; int item_index = IslandGemBird.GetItemIndex(bird_type5); if (pedestal.requiredItem.Value == null || pedestal.requiredItem.Value.ParentSheetIndex != item_index) { pedestal.requiredItem.Value = new Object(Vector2.Zero, item_index, 1); if (pedestal.heldObject.Value != null && pedestal.heldObject.Value.ParentSheetIndex != item_index) { pedestal.heldObject.Value = null; } } } }
public override void OnPickup(ItemPedestal pedestal, PlayerController player) { base.OnPickup(pedestal, player); player.hasFasPolicy = true; player.temporaryDamage = player.damage; }
public override void OnPickup(ItemPedestal pedestal, PlayerController player) { base.OnPickup(pedestal, player); player.hasHeartLocket = true; player.heartLocketActive = true; }
public override void OnPickup(ItemPedestal pedestal, PlayerController player) { base.OnPickup(pedestal, player); player.hasMorsKnife = true; player.Knifeprefab = projectilePrefab; }
public virtual void OnPickup(ItemPedestal pedestal, PlayerController player) { taken = true; player.PickUpItem(pedestal, this); }
public override void OnPickup(ItemPedestal pedestal, PlayerController player) { base.OnPickup(pedestal, player); player.damage *= 2f; player.accuracy *= 3f; }