Skip to content

Commit fe2c8f9

Browse files
committed
[new] Add the faster snowball glove and the snowball with a bone #1
1 parent 7bd87a0 commit fe2c8f9

10 files changed

+172
-6
lines changed

Items/BigSnowball.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public override void SetDefaults()
4444
public override void AddRecipes()
4545
{
4646
ModRecipe recipe = new ModRecipe(mod);
47-
recipe.AddIngredient(ItemID.Snowball, 3);
47+
recipe.AddIngredient(ItemID.Snowball, 4);
4848
recipe.AddTile(TileID.WorkBenches);
4949
recipe.SetResult(this, 1);
5050
recipe.AddRecipe();

Items/FasterSnowballGlove.cs

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
using Microsoft.Xna.Framework;
2+
using Terraria;
3+
using Terraria.ID;
4+
using Terraria.ModLoader;
5+
6+
namespace SnowballFight.Items
7+
{
8+
public class FasterSnowballGlove : ModItem
9+
{
10+
public override void SetStaticDefaults()
11+
{
12+
// DisplayName.SetDefault("TutorialSword"); // By default, capitalization in classnames will add spaces to the display name. You can customize the display name here by uncommenting this line.
13+
Tooltip.SetDefault("This is a snowball glove");
14+
}
15+
16+
public override void SetDefaults()
17+
{
18+
item.damage = 8;
19+
item.crit = 0;
20+
item.width = 28;
21+
item.height = 26;
22+
23+
item.useTime = 16;
24+
item.useAnimation = 16;
25+
item.useStyle = 1;
26+
item.knockBack = 2;
27+
item.value = 10000;
28+
item.rare = 2;
29+
item.UseSound = SoundID.Item1;
30+
item.autoReuse = true;
31+
32+
item.noMelee = true;
33+
item.noUseGraphic = true;
34+
35+
item.shoot = 1;
36+
item.shootSpeed = 8;
37+
item.ranged = true;
38+
item.useAmmo = AmmoID.Snowball;
39+
}
40+
41+
public override void AddRecipes()
42+
{
43+
ModRecipe recipe = new ModRecipe(mod);
44+
recipe.AddIngredient(ModContent.ItemType<SnowballGlove>(), 1);
45+
recipe.AddIngredient(ItemID.SkeletronHand, 1);
46+
recipe.AddIngredient(ItemID.Bone, 10);
47+
recipe.AddTile(TileID.TinkerersWorkbench);
48+
recipe.SetResult(this);
49+
recipe.AddRecipe();
50+
}
51+
52+
public override void OnConsumeAmmo(Player player) {
53+
const int NUM_DUSTS = 10;
54+
float posX = player.position.X;
55+
float posY = player.position.Y;
56+
for (int i = 0; i < NUM_DUSTS; i++)
57+
{
58+
Dust.NewDust(new Vector2(posX, posY), item.width, item.height, 192, 0f, 0f, 50, new Color(255,255,255));
59+
posX--;
60+
posY--;
61+
}
62+
}
63+
}
64+
}

Items/FasterSnowballGlove.png

435 Bytes
Loading

Items/SnowballGlove.cs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,18 @@ public class SnowballGlove : ModItem
1010
public override void SetStaticDefaults()
1111
{
1212
// DisplayName.SetDefault("TutorialSword"); // By default, capitalization in classnames will add spaces to the display name. You can customize the display name here by uncommenting this line.
13-
Tooltip.SetDefault("This is a snowball glove.");
13+
Tooltip.SetDefault("This is a snowball glove");
1414
}
1515

1616
public override void SetDefaults()
1717
{
1818
item.damage = 5;
19+
item.crit = -2;
1920
item.width = 28;
2021
item.height = 26;
21-
item.useTime = 20;
22-
item.useAnimation = 20;
22+
23+
item.useTime = 22;
24+
item.useAnimation = 22;
2325
item.useStyle = 1;
2426
item.knockBack = 1;
2527
item.value = 10000;
@@ -31,7 +33,7 @@ public override void SetDefaults()
3133
item.noUseGraphic = true;
3234

3335
item.shoot = 1;
34-
item.shootSpeed = 8;
36+
item.shootSpeed = 4;
3537
item.ranged = true;
3638
item.useAmmo = AmmoID.Snowball;
3739
}
@@ -58,7 +60,7 @@ public override void OnConsumeAmmo(Player player) {
5860
float posY = player.position.Y;
5961
for (int i = 0; i < NUM_DUSTS; i++)
6062
{
61-
Dust.NewDust(new Vector2(posX, posY), item.width, item.height, 192, 0f, 0f, 100, new Color(255,255,255));
63+
Dust.NewDust(new Vector2(posX, posY), item.width, item.height, 192, 0f, 0f, 50, new Color(255,255,255));
6264
posX--;
6365
posY--;
6466
}

Items/SnowballWithBone.cs

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
using SnowballFight.Projectiles;
2+
using Terraria;
3+
using Terraria.ID;
4+
using Terraria.ModLoader;
5+
6+
namespace SnowballFight.Items
7+
{
8+
public class SnowballWithBone : ModItem
9+
{
10+
public override void SetStaticDefaults()
11+
{
12+
// DisplayName.SetDefault("TutorialSword"); // By default, capitalization in classnames will add spaces to the display name. You can customize the display name here by uncommenting this line.
13+
Tooltip.SetDefault("A snowball with a stone");
14+
}
15+
16+
public override void SetDefaults()
17+
{
18+
item.damage = 25;
19+
item.width = 20;
20+
item.height = 20;
21+
22+
item.ranged = true;
23+
item.useTime = 20;
24+
item.useAnimation = 20;
25+
item.useStyle = 1;
26+
item.knockBack = 6.0f;
27+
28+
item.value = 10000;
29+
item.rare = 2;
30+
item.UseSound = SoundID.Item1;
31+
item.autoReuse = false;
32+
33+
item.shoot = ModContent.ProjectileType<SnowballWithBoneProjectile>();
34+
item.shootSpeed = 8f;
35+
item.consumable = true;
36+
item.maxStack = 999;
37+
38+
item.noMelee = true;
39+
item.noUseGraphic = true;
40+
41+
item.ammo = AmmoID.Snowball;
42+
}
43+
44+
public override void AddRecipes()
45+
{
46+
ModRecipe recipe = new ModRecipe(mod);
47+
recipe.AddIngredient(ItemID.Snowball, 2);
48+
recipe.AddIngredient(ItemID.Bone, 1);
49+
recipe.AddTile(TileID.WorkBenches);
50+
recipe.SetResult(this, 1);
51+
recipe.AddRecipe();
52+
}
53+
}
54+
}

Items/SnowballWithBone.png

400 Bytes
Loading

Items/SnowballWithStone.png

-56 Bytes
Loading
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
using Microsoft.Xna.Framework;
2+
using Terraria;
3+
using Terraria.ID;
4+
using Terraria.ModLoader;
5+
6+
namespace SnowballFight.Projectiles
7+
{
8+
public class SnowballWithBoneProjectile : ModProjectile
9+
{
10+
public override void SetStaticDefaults()
11+
{
12+
DisplayName.SetDefault("A snowball with a stone");
13+
}
14+
15+
public override void SetDefaults()
16+
{
17+
projectile.damage = 25;
18+
projectile.width = 20;
19+
projectile.height = 20;
20+
21+
projectile.aiStyle = 2;
22+
projectile.ranged = true;
23+
projectile.friendly = true;
24+
projectile.knockBack = 6.0f;
25+
}
26+
27+
public override bool OnTileCollide(Vector2 oldVelocity)
28+
{
29+
Main.PlaySound(SoundID.Item51, projectile.position);
30+
Main.PlaySound(SoundID.Dig, projectile.position);
31+
32+
const int NUM_DUSTS = 10;
33+
float posX = projectile.position.X;
34+
float posY = projectile.position.Y;
35+
for (int i = 0; i < NUM_DUSTS; i++)
36+
{
37+
// 51, 76, 192
38+
Dust.NewDust(new Vector2(posX, posY), projectile.width, projectile.height, 192);
39+
posX--;
40+
posY--;
41+
}
42+
43+
return true;
44+
}
45+
}
46+
}
400 Bytes
Loading
-56 Bytes
Loading

0 commit comments

Comments
 (0)