-
Notifications
You must be signed in to change notification settings - Fork 3
/
WaterWhip.cs
81 lines (76 loc) · 2.57 KB
/
WaterWhip.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace JoostMod.Items.Weapons
{
public class WaterWhip : ModItem
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Water Tendril");
Tooltip.SetDefault("Left click for a slapping tendril\n" +
"Damage dealt is based on the tendril's speed\n" +
"Right click for a grasping tendril\n" +
"Grabs hit enemies and items");
}
public override void SetDefaults()
{
item.damage = 66;
item.magic = true;
item.width = 36;
item.height = 36;
item.mana = 12;
item.channel = true;
item.useStyle = 5;
item.noUseGraphic = true;
item.noMelee = true;
item.useTime = 26;
item.useAnimation = 26;
item.reuseDelay = 2;
item.value = 225000;
item.rare = 5;
item.knockBack = 8;
item.UseSound = SoundID.Item21;
item.autoReuse = true;
item.shoot = mod.ProjectileType("WaterWhip");
item.shootSpeed = 5f;
}
public override bool AltFunctionUse(Player player)
{
return true;
}
public override bool CanUseItem(Player player)
{
if (player.altFunctionUse == 2)
{
item.UseSound = SoundID.Item21;
}
else
{
item.UseSound = SoundID.Item21;
}
return base.CanUseItem(player);
}
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
if (player.altFunctionUse == 2)
{
type = mod.ProjectileType("WaterWhip2");
}
Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI, 0, -1);
return false;
}
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(null, "WaterEssence", 50);
recipe.AddRecipeGroup("JoostMod:AnyCobalt", 4);
recipe.AddRecipeGroup("JoostMod:AnyMythril", 4);
recipe.AddRecipeGroup("JoostMod:AnyAdamantite", 4);
recipe.AddTile(null, "ElementalForge");
recipe.SetResult(this);
recipe.AddRecipe();
}
}
}