Skip to content

Commit 138d26f

Browse files
committed
[fix] Refactor and changes in values and rarity
[new] Add the first version of snowball with grenade
1 parent fe2c8f9 commit 138d26f

21 files changed

+145
-25
lines changed

Items/FasterSnowballGlove.cs renamed to Items/Gloves/FasterSnowballGlove.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
using Terraria.ID;
44
using Terraria.ModLoader;
55

6-
namespace SnowballFight.Items
6+
namespace SnowballFight.Items.Gloves
77
{
88
public class FasterSnowballGlove : ModItem
99
{
@@ -24,8 +24,8 @@ public override void SetDefaults()
2424
item.useAnimation = 16;
2525
item.useStyle = 1;
2626
item.knockBack = 2;
27-
item.value = 10000;
28-
item.rare = 2;
27+
item.value = 65000;
28+
item.rare = ItemRarityID.Orange;
2929
item.UseSound = SoundID.Item1;
3030
item.autoReuse = true;
3131

File renamed without changes.

Items/SnowballGlove.cs renamed to Items/Gloves/SnowballGlove.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
using Terraria.ID;
44
using Terraria.ModLoader;
55

6-
namespace SnowballFight.Items
6+
namespace SnowballFight.Items.Gloves
77
{
88
public class SnowballGlove : ModItem
99
{
@@ -25,7 +25,7 @@ public override void SetDefaults()
2525
item.useStyle = 1;
2626
item.knockBack = 1;
2727
item.value = 10000;
28-
item.rare = 2;
28+
item.rare = ItemRarityID.Green;
2929
item.UseSound = SoundID.Item1;
3030
item.autoReuse = true;
3131

File renamed without changes.

Items/BigSnowball.cs renamed to Items/Snowballs/BigSnowball.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
using Terraria.ID;
44
using Terraria.ModLoader;
55

6-
namespace SnowballFight.Items
6+
namespace SnowballFight.Items.Snowballs
77
{
88
public class BigSnowball : ModItem
99
{
@@ -16,17 +16,18 @@ public override void SetStaticDefaults()
1616
public override void SetDefaults()
1717
{
1818
item.damage = 20;
19+
item.knockBack = 6.5f;
20+
1921
item.width = 30;
2022
item.height = 30;
2123

2224
item.ranged = true;
2325
item.useTime = 20;
2426
item.useAnimation = 20;
2527
item.useStyle = 1;
26-
item.knockBack = 6.5f;
2728

28-
item.value = 10000;
29-
item.rare = 2;
29+
item.value = 0;
30+
item.rare = ItemRarityID.White;
3031
item.UseSound = SoundID.Item1;
3132
item.autoReuse = false;
3233

File renamed without changes.

Items/SmallSnowball.cs renamed to Items/Snowballs/SmallSnowball.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
using Terraria.ID;
44
using Terraria.ModLoader;
55

6-
namespace SnowballFight.Items
6+
namespace SnowballFight.Items.Snowballs
77
{
88
public class SmallSnowball : ModItem
99
{
@@ -16,17 +16,18 @@ public override void SetStaticDefaults()
1616
public override void SetDefaults()
1717
{
1818
item.damage = 4;
19+
item.knockBack = 3f;
20+
1921
item.width = 10;
2022
item.height = 10;
2123

2224
item.ranged = true;
2325
item.useTime = 20;
2426
item.useAnimation = 20;
2527
item.useStyle = 1;
26-
item.knockBack = 3f;
2728

28-
item.value = 10000;
29-
item.rare = 2;
29+
item.value = 0;
30+
item.rare = ItemRarityID.White;
3031
item.UseSound = SoundID.Item1;
3132
item.autoReuse = false;
3233

File renamed without changes.

Items/SnowballWithBone.cs renamed to Items/Snowballs/SnowballWithBone.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
using Terraria.ID;
44
using Terraria.ModLoader;
55

6-
namespace SnowballFight.Items
6+
namespace SnowballFight.Items.Snowballs
77
{
88
public class SnowballWithBone : ModItem
99
{
@@ -16,17 +16,18 @@ public override void SetStaticDefaults()
1616
public override void SetDefaults()
1717
{
1818
item.damage = 25;
19+
item.knockBack = 6.0f;
20+
1921
item.width = 20;
2022
item.height = 20;
2123

2224
item.ranged = true;
2325
item.useTime = 20;
2426
item.useAnimation = 20;
2527
item.useStyle = 1;
26-
item.knockBack = 6.0f;
2728

28-
item.value = 10000;
29-
item.rare = 2;
29+
item.value = 50;
30+
item.rare = ItemRarityID.White;
3031
item.UseSound = SoundID.Item1;
3132
item.autoReuse = false;
3233

File renamed without changes.
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
using SnowballFight.Projectiles;
2+
using Terraria;
3+
using Terraria.ID;
4+
using Terraria.ModLoader;
5+
6+
namespace SnowballFight.Items.Snowballs
7+
{
8+
public class SnowballWithGrenade : 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 = 65;
19+
item.knockBack = 8.0f;
20+
21+
item.width = 20;
22+
item.height = 20;
23+
24+
item.ranged = true;
25+
item.useTime = 40;
26+
item.useAnimation = 40;
27+
item.useStyle = 1;
28+
29+
item.value = 75;
30+
item.rare = ItemRarityID.White;
31+
item.UseSound = SoundID.Item1;
32+
item.autoReuse = false;
33+
34+
item.shoot = ModContent.ProjectileType<SnowballWithGrenadeProjectile>();
35+
item.shootSpeed = 8f;
36+
item.consumable = true;
37+
item.maxStack = 999;
38+
39+
item.noMelee = true;
40+
item.noUseGraphic = true;
41+
42+
item.ammo = AmmoID.Snowball;
43+
}
44+
45+
public override void AddRecipes()
46+
{
47+
ModRecipe recipe = new ModRecipe(mod);
48+
recipe.AddIngredient(ItemID.Snowball, 2);
49+
recipe.AddIngredient(ItemID.Grenade, 1);
50+
recipe.AddTile(TileID.WorkBenches);
51+
recipe.SetResult(this, 1);
52+
recipe.AddRecipe();
53+
}
54+
}
55+
}
556 Bytes
Loading

Items/SnowballWithStone.cs renamed to Items/Snowballs/SnowballWithStone.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
using Terraria.ID;
44
using Terraria.ModLoader;
55

6-
namespace SnowballFight.Items
6+
namespace SnowballFight.Items.Snowballs
77
{
88
public class SnowballWithStone : ModItem
99
{
@@ -16,17 +16,18 @@ public override void SetStaticDefaults()
1616
public override void SetDefaults()
1717
{
1818
item.damage = 15;
19+
item.knockBack = 6.0f;
20+
1921
item.width = 20;
2022
item.height = 20;
2123

2224
item.ranged = true;
2325
item.useTime = 20;
2426
item.useAnimation = 20;
2527
item.useStyle = 1;
26-
item.knockBack = 6.0f;
2728

28-
item.value = 10000;
29-
item.rare = 2;
29+
item.value = 0;
30+
item.rare = ItemRarityID.White;
3031
item.UseSound = SoundID.Item1;
3132
item.autoReuse = false;
3233

File renamed without changes.

Projectiles/BigSnowballProjectile.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,14 @@ public override void SetStaticDefaults()
1515
public override void SetDefaults()
1616
{
1717
projectile.damage = 20;
18+
projectile.knockBack = 6.5f;
19+
1820
projectile.width = 30;
1921
projectile.height = 30;
2022

2123
projectile.aiStyle = 2;
2224
projectile.ranged = true;
2325
projectile.friendly = true;
24-
projectile.knockBack = 6.5f;
2526
}
2627

2728
public override bool OnTileCollide(Vector2 oldVelocity)

Projectiles/SmallSnowballProjectile.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,14 @@ public override void SetStaticDefaults()
1515
public override void SetDefaults()
1616
{
1717
projectile.damage = 4;
18+
projectile.knockBack = 3f;
19+
1820
projectile.width = 10;
1921
projectile.height = 10;
2022

2123
projectile.aiStyle = 2;
2224
projectile.ranged = true;
2325
projectile.friendly = true;
24-
projectile.knockBack = 3f;
2526
}
2627

2728
public override bool OnTileCollide(Vector2 oldVelocity)

Projectiles/SnowballWithBoneProjectile.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,14 @@ public override void SetStaticDefaults()
1515
public override void SetDefaults()
1616
{
1717
projectile.damage = 25;
18+
projectile.knockBack = 6.0f;
19+
1820
projectile.width = 20;
1921
projectile.height = 20;
2022

2123
projectile.aiStyle = 2;
2224
projectile.ranged = true;
2325
projectile.friendly = true;
24-
projectile.knockBack = 6.0f;
2526
}
2627

2728
public override bool OnTileCollide(Vector2 oldVelocity)
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
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 SnowballWithGrenadeProjectile : 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 = 65;
18+
projectile.knockBack = 8.0f;
19+
20+
projectile.width = 20;
21+
projectile.height = 20;
22+
23+
projectile.aiStyle = 2;
24+
projectile.ranged = true;
25+
projectile.friendly = true;
26+
}
27+
28+
public override bool OnTileCollide(Vector2 oldVelocity)
29+
{
30+
Main.PlaySound(SoundID.Item51, projectile.position);
31+
Main.PlaySound(SoundID.Dig, projectile.position);
32+
33+
const int NUM_DUSTS = 10;
34+
float posX = projectile.position.X;
35+
float posY = projectile.position.Y;
36+
for (int i = 0; i < NUM_DUSTS; i++)
37+
{
38+
// 51, 76, 192
39+
Dust.NewDust(new Vector2(posX, posY), projectile.width, projectile.height, 192);
40+
posX--;
41+
posY--;
42+
}
43+
44+
return true;
45+
}
46+
}
47+
}
556 Bytes
Loading

Projectiles/SnowballWithStoneProjectile.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,14 @@ public override void SetStaticDefaults()
1515
public override void SetDefaults()
1616
{
1717
projectile.damage = 15;
18+
projectile.knockBack = 6.0f;
19+
1820
projectile.width = 20;
1921
projectile.height = 20;
2022

2123
projectile.aiStyle = 2;
2224
projectile.ranged = true;
2325
projectile.friendly = true;
24-
projectile.knockBack = 6.0f;
2526
}
2627

2728
public override bool OnTileCollide(Vector2 oldVelocity)

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,13 @@ Items added for the moment :
77
- Snowball Glove
88
- Small Snowball
99
- Big Snowball
10+
- Snowball with a stone
11+
12+
TODO :
13+
Accessoire : Hidden Glove Pocket : permet un double shoot à chaque tir
14+
-> vine + morceau d'aile de démon
15+
Level 1 : Permet d'envoyer les snowball de poids classique
16+
Level 2 : Augmentation de la distance + knockback + damage + permet d'envoyer les snowball de poids lourds (grenade)
17+
Level 3 : with frost core -> permet d'envoyer toutes les snowball + les iceball de poids classiques + peut mettre le debuff chilled
18+
Level 4 : with ice turtle shell + mechanical glove -> permet d'envoyer des iceball de type heavy
19+
Level 5 : with handwarmer (accessoire ?) -> permet de mettre le debuff frozen

0 commit comments

Comments
 (0)