fruit chipper
This commit is contained in:
1 parent
5cbb636617
commit
ea90f26637
7 files changed
+53
-10
No files matched your search
@@ -333,7 +333,7 @@ namespace CalamityMod.Items
|
||||
#endregion
|
||||
|
||||
#region CATEGORY 3: Tool Balancing
|
||||
{ ItemID.AcornAxe, Do(AxePower(125)) }, // Axe of Regrowth
|
||||
{ ItemID.AcornAxe, Do(AxePower(100)) }, // Axe of Regrowth
|
||||
{ ItemID.AdamantiteChainsaw, Do(TrueMeleeNoSpeed, AxePower(90), UseTimeExact(4), TileBoostExact(+0), DamageExact(75)) },
|
||||
{ ItemID.AdamantiteDrill, Do(TrueMeleeNoSpeed, PickPower(180), UseTimeExact(4), TileBoostExact(+1), DamageExact(32)) },
|
||||
{ ItemID.AdamantitePickaxe, Do(PickPower(180), UseTimeExact(8), TileBoostExact(+1)) },
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace CalamityMod.Items.Tools
|
||||
{
|
||||
CreateRecipe().
|
||||
AddRecipeGroup("AnySilverBar", 18).
|
||||
AddRecipeGroup("Wood", 18).
|
||||
AddIngredient(ItemID.RichMahogany, 18).
|
||||
AddTile(TileID.Anvils).
|
||||
Register();
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ using CalamityMod.Gores.Trees;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Items.Placeables.Abyss;
|
||||
using CalamityMod.Items.Potions.Food;
|
||||
using CalamityMod.Items.Tools;
|
||||
using CalamityMod.NPCs.AcidRain;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
@@ -54,6 +55,15 @@ namespace CalamityMod.Tiles.Abyss
|
||||
// Returning false at the end prevents vanilla behavior as the default is palm tree behavior which can include undesirable stuff like seagulls
|
||||
public override bool Shake(int x, int y, ref bool createLeaves)
|
||||
{
|
||||
// 33% chance to drop extra fruit when using Feller of Evergreens
|
||||
Vector2 worldPosition = new Vector2(x, y).ToWorldCoordinates();
|
||||
Player nearestPlayer = Main.player[Player.FindClosest(worldPosition, 16, 16)];
|
||||
if (nearestPlayer.active && nearestPlayer.ActiveItem().type == ModContent.ItemType<FellerofEvergreens>() && WorldGen.genRand.NextBool(3))
|
||||
{
|
||||
int treeDropItemType = WorldGen.genRand.NextBool() ? ModContent.ItemType<Jackfruit>() : ModContent.ItemType<Salak>();
|
||||
Item.NewItem(WorldGen.GetItemSource_FromTreeShake(x, y), x * 16, y * 16, 16, 16, treeDropItemType);
|
||||
}
|
||||
|
||||
int randAmt = Main.rand.Next(1, 3);
|
||||
|
||||
if (Main.getGoodWorld && Main.rand.NextBool(15))
|
||||
@@ -115,7 +125,7 @@ namespace CalamityMod.Tiles.Abyss
|
||||
if (type != -1)
|
||||
Item.NewItem(WorldGen.GetItemSource_FromTreeShake(x, y), new Vector2(x, y) * 16, type, randAmt);
|
||||
}
|
||||
else if (Main.rand.NextBool(3))
|
||||
else if (Main.rand.NextBool(12))
|
||||
{
|
||||
int fruitType = Main.rand.NextBool() ? ModContent.ItemType<Jackfruit>() : ModContent.ItemType<Salak>();
|
||||
Item.NewItem(WorldGen.GetItemSource_FromTreeShake(x, y), new Vector2(x, y) * 16, fruitType);
|
||||
|
||||
@@ -3,6 +3,7 @@ using CalamityMod.Dusts;
|
||||
using CalamityMod.Gores.Trees;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Items.Potions.Food;
|
||||
using CalamityMod.Items.Tools;
|
||||
using CalamityMod.NPCs.Astral;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
@@ -73,6 +74,15 @@ namespace CalamityMod.Tiles.Astral
|
||||
// Returning false at the end prevents vanilla behavior as the default is forest tree behavior which can include undesirable stuff like squirrels and butterflies
|
||||
public override bool Shake(int x, int y, ref bool createLeaves)
|
||||
{
|
||||
// 33% chance to drop extra fruit when using Feller of Evergreens
|
||||
Vector2 worldPosition = new Vector2(x, y).ToWorldCoordinates();
|
||||
Player nearestPlayer = Main.player[Player.FindClosest(worldPosition, 16, 16)];
|
||||
if (nearestPlayer.active && nearestPlayer.ActiveItem().type == ModContent.ItemType<FellerofEvergreens>() && WorldGen.genRand.NextBool(3))
|
||||
{
|
||||
int treeDropItemType = WorldGen.genRand.NextBool() ? ModContent.ItemType<Barberry>() : ModContent.ItemType<Lotus>();
|
||||
Item.NewItem(WorldGen.GetItemSource_FromTreeShake(x, y), x * 16, y * 16, 16, 16, treeDropItemType);
|
||||
}
|
||||
|
||||
int randAmt = Main.rand.Next(1, 3);
|
||||
if (Main.getGoodWorld && Main.rand.NextBool(15))
|
||||
{
|
||||
@@ -137,7 +147,7 @@ namespace CalamityMod.Tiles.Astral
|
||||
type = ItemID.FallenStar;
|
||||
Item.NewItem(WorldGen.GetItemSource_FromTreeShake(x, y), new Vector2(x, y) * 16, type, randAmt);
|
||||
}
|
||||
else if (Main.rand.NextBool(3))
|
||||
else if (Main.rand.NextBool(12))
|
||||
{
|
||||
int fruitType = Main.rand.NextBool() ? ModContent.ItemType<Barberry>() : ModContent.ItemType<Lotus>();
|
||||
Item.NewItem(WorldGen.GetItemSource_FromTreeShake(x, y), new Vector2(x, y) * 16, fruitType);
|
||||
|
||||
@@ -3,6 +3,7 @@ using CalamityMod.Dusts;
|
||||
using CalamityMod.Gores.Trees;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Items.Potions.Food;
|
||||
using CalamityMod.Items.Tools;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using ReLogic.Content;
|
||||
@@ -71,6 +72,16 @@ namespace CalamityMod.Tiles.AstralDesert
|
||||
// Returning false at the end prevents vanilla behavior as the default is palm tree behavior which can include undesirable stuff like seagulls
|
||||
public override bool Shake(int x, int y, ref bool createLeaves)
|
||||
{
|
||||
// 33% chance to drop extra fruit when using Feller of Evergreens
|
||||
Vector2 worldPosition = new Vector2(x, y).ToWorldCoordinates();
|
||||
Player nearestPlayer = Main.player[Player.FindClosest(worldPosition, 16, 16)];
|
||||
if (nearestPlayer.active && nearestPlayer.ActiveItem().type == ModContent.ItemType<FellerofEvergreens>() && WorldGen.genRand.NextBool(3))
|
||||
{
|
||||
int treeDropItemType = WorldGen.genRand.NextBool() ? (WorldGen.genRand.NextBool() ? ItemID.Coconut : ItemID.Banana)
|
||||
: (WorldGen.genRand.NextBool() ? ModContent.ItemType<Barberry>() : ModContent.ItemType<Lotus>());
|
||||
Item.NewItem(WorldGen.GetItemSource_FromTreeShake(x, y), x * 16, y * 16, 16, 16, treeDropItemType);
|
||||
}
|
||||
|
||||
int randAmt = Main.rand.Next(1, 3);
|
||||
|
||||
if (Main.getGoodWorld && Main.rand.NextBool(15))
|
||||
@@ -123,12 +134,12 @@ namespace CalamityMod.Tiles.AstralDesert
|
||||
type = ItemID.FallenStar;
|
||||
Item.NewItem(WorldGen.GetItemSource_FromTreeShake(x, y), new Vector2(x, y) * 16, type, randAmt);
|
||||
}
|
||||
else if (Main.rand.Next(36) < 5) // Vanilla palm fruit logic goes first
|
||||
else if (Main.rand.NextBool(12)) // Vanilla palm fruit logic goes first
|
||||
{
|
||||
int fruitType = Main.rand.NextBool() ? ItemID.Coconut : ItemID.Banana;
|
||||
Item.NewItem(WorldGen.GetItemSource_FromTreeShake(x, y), new Vector2(x, y) * 16, fruitType);
|
||||
}
|
||||
else if (Main.rand.Next(36) < 5)
|
||||
else if (Main.rand.NextBool(12))
|
||||
{
|
||||
int fruitType = Main.rand.NextBool() ? ModContent.ItemType<Barberry>() : ModContent.ItemType<Lotus>();
|
||||
Item.NewItem(WorldGen.GetItemSource_FromTreeShake(x, y), new Vector2(x, y) * 16, fruitType);
|
||||
|
||||
@@ -3,6 +3,7 @@ using CalamityMod.Dusts;
|
||||
using CalamityMod.Gores.Trees;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Items.Potions.Food;
|
||||
using CalamityMod.Items.Tools;
|
||||
using CalamityMod.NPCs.Astral;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
@@ -74,6 +75,15 @@ namespace CalamityMod.Tiles.AstralSnow
|
||||
// Returning false at the end prevents vanilla behavior as the default is forest tree behavior which can include undesirable stuff like squirrels and butterflies
|
||||
public override bool Shake(int x, int y, ref bool createLeaves)
|
||||
{
|
||||
// 33% chance to drop extra fruit when using Feller of Evergreens
|
||||
Vector2 worldPosition = new Vector2(x, y).ToWorldCoordinates();
|
||||
Player nearestPlayer = Main.player[Player.FindClosest(worldPosition, 16, 16)];
|
||||
if (nearestPlayer.active && nearestPlayer.ActiveItem().type == ModContent.ItemType<FellerofEvergreens>() && WorldGen.genRand.NextBool(3))
|
||||
{
|
||||
int treeDropItemType = WorldGen.genRand.NextBool() ? ModContent.ItemType<Cometfruit>() : ModContent.ItemType<Mangosteen>();
|
||||
Item.NewItem(WorldGen.GetItemSource_FromTreeShake(x, y), x * 16, y * 16, 16, 16, treeDropItemType);
|
||||
}
|
||||
|
||||
int randAmt = Main.rand.Next(1, 3);
|
||||
|
||||
if (Main.getGoodWorld && Main.rand.NextBool(15))
|
||||
@@ -137,7 +147,7 @@ namespace CalamityMod.Tiles.AstralSnow
|
||||
type = ItemID.FallenStar;
|
||||
Item.NewItem(WorldGen.GetItemSource_FromTreeShake(x, y), new Vector2(x, y) * 16, type, randAmt);
|
||||
}
|
||||
else if (Main.rand.NextBool(3))
|
||||
else if (Main.rand.NextBool(12))
|
||||
{
|
||||
int fruitType = Main.rand.NextBool() ? ModContent.ItemType<Cometfruit>() : ModContent.ItemType<Mangosteen>();
|
||||
Item.NewItem(WorldGen.GetItemSource_FromTreeShake(x, y), new Vector2(x, y) * 16, fruitType);
|
||||
|
||||
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using CalamityMod.Enums;
|
||||
using CalamityMod.Items.Accessories.Vanity;
|
||||
using CalamityMod.Items.Tools;
|
||||
using CalamityMod.Items.VanillaArmorChanges;
|
||||
using CalamityMod.Items.Weapons.Melee;
|
||||
using CalamityMod.Tiles.Abyss;
|
||||
@@ -24,7 +25,6 @@ namespace CalamityMod.Tiles
|
||||
{
|
||||
public class CalamityGlobalTile : GlobalTile
|
||||
{
|
||||
|
||||
public static List<int> GrowthTiles = new List<int>()
|
||||
{
|
||||
TileType<SeaPrism>(),
|
||||
@@ -48,8 +48,10 @@ namespace CalamityMod.Tiles
|
||||
|
||||
public override void PreShakeTree(int x, int y, TreeTypes treeType)
|
||||
{
|
||||
// Add an additional 25% chance to drop vanilla fruits
|
||||
if (WorldGen.genRand.NextBool(4))
|
||||
// All trees have a 33% chance to drop extra fruit when using Feller of Evergreens
|
||||
Vector2 worldPosition = new Vector2(x, y).ToWorldCoordinates();
|
||||
Player nearestPlayer = Main.player[Player.FindClosest(worldPosition, 16, 16)];
|
||||
if (nearestPlayer.active && nearestPlayer.ActiveItem().type == ItemType<FellerofEvergreens>() && WorldGen.genRand.NextBool(3))
|
||||
{
|
||||
int treeDropItemType = 0;
|
||||
switch (treeType)
|
||||
|
||||
Reference in new issue
Block a user