This commit is contained in:
Shucks committed 2019-12-26 14:02:49 -06:00
commit ebf96ad7b4
81 files changed
+1402 -338

No files matched your search

+7 -2
View File
@@ -59,9 +59,14 @@ namespace CalamityMod.Buffs
else if (type == BuffID.Slow)
{
if (npc.Calamity().slowed < npc.buffTime[buffIndex])
{
npc.Calamity().slowed = npc.buffTime[buffIndex];
}
npc.DelBuff(buffIndex);
buffIndex--;
}
if (type == BuffID.Electrified)
{
if (npc.Calamity().electrified < npc.buffTime[buffIndex])
npc.Calamity().electrified = npc.buffTime[buffIndex];
npc.DelBuff(buffIndex);
buffIndex--;
}
+1 -1
View File
@@ -24,7 +24,7 @@ namespace CalamityMod.Items.Armor
item.height = 18;
item.value = Item.buyPrice(0, 30, 0, 0);
item.rare = 8;
item.defense = 12; //45
item.defense = 9; //35
}
public override bool IsArmorSet(Item head, Item body, Item legs)
+1 -1
View File
@@ -21,7 +21,7 @@ namespace CalamityMod.Items.Armor
item.height = 18;
item.value = Item.buyPrice(0, 18, 0, 0);
item.rare = 8;
item.defense = 15;
item.defense = 11;
}
public override void UpdateEquip(Player player)
+1 -1
View File
@@ -22,7 +22,7 @@ namespace CalamityMod.Items.Armor
item.height = 18;
item.value = Item.buyPrice(0, 24, 0, 0);
item.rare = 8;
item.defense = 18;
item.defense = 14;
}
public override void UpdateEquip(Player player)
+1
View File
@@ -1886,6 +1886,7 @@ Grants immunity to fire blocks, and temporary immunity to lava";
case ItemID.HallowedFishingCrate:
DropHelper.DropItemCondition(player, ModContent.ItemType<UnholyEssence>(), NPC.downedMoonlord, 0.2f, 5, 10);
DropHelper.DropItemCondition(player, (WorldGen.crimson ? ModContent.ItemType<ProfanedRagePotion>() : ModContent.ItemType<HolyWrathPotion>()), CalamityWorld.downedProvidence, 0.2f, 1, 3);
break;
case ItemID.DungeonFishingCrate:
+64
View File
@@ -0,0 +1,64 @@
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using CalamityMod.Projectiles.Magic;
namespace CalamityMod.Items.Weapons.Magic
{
public class AbyssShocker : ModItem
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Abyss Shocker");
Tooltip.SetDefault("Fires an erratic lightning bolt that arcs and bounces between enemies");
}
public override void SetDefaults()
{
item.damage = 15;
item.noMelee = true;
item.magic = true;
item.channel = true;
item.width = 86;
item.height = 32;
item.useTime = 50;
item.useAnimation = 20;
item.UseSound = SoundID.Item13;
item.useStyle = 5;
item.mana = 10;
item.value = Item.buyPrice(0, 4, 0, 0);
item.rare = 3;
item.Calamity().postMoonLordRarity = 21;
item.shoot = ModContent.ProjectileType<LightningArc>();
item.shootSpeed = 14f;
}
public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI)
{
Texture2D texture = ModContent.GetTexture("CalamityMod/Items/Weapons/Magic/AbyssShocker_mask");
spriteBatch.Draw
(
texture,
new Vector2
(
item.position.X - Main.screenPosition.X + item.width * 0.5f,
item.position.Y - Main.screenPosition.Y + item.height - texture.Height * 0.5f + 2f
),
new Rectangle(0, 0, texture.Width, texture.Height),
Color.White,
rotation,
texture.Size() * 0.5f,
scale,
SpriteEffects.None,
0f
);
}
public override Vector2? HoldoutOffset()
{
return new Vector2(-14, 0);
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 623 B

+2 -10
View File
@@ -11,9 +11,6 @@ namespace CalamityMod.Items.Weapons.Magic
{
public class HeliumFlash : ModItem
{
public static int BaseDamage = 1280;
public static float Speed = 15f;
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Helium Flash");
@@ -26,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Magic
item.width = 76;
item.height = 76;
item.magic = true;
item.damage = BaseDamage;
item.damage = 1280;
item.knockBack = 9.5f;
item.mana = 26;
item.useAnimation = 37;
@@ -42,12 +39,7 @@ namespace CalamityMod.Items.Weapons.Magic
item.value = Item.buyPrice(1, 80, 0, 0);
item.shoot = ModContent.ProjectileType<VolatileStarcore>();
item.shootSpeed = Speed;
}
public override Vector2? HoldoutOrigin()
{
return new Vector2(15, 15);
item.shootSpeed = 15f;
}
// Creates dust at the tip of the staff when used.
+18 -8
View File
@@ -11,24 +11,34 @@ namespace CalamityMod.Items.Weapons.Melee
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Air Spinner");
Tooltip.SetDefault("Fires feathers when enemies are near");
Tooltip.SetDefault("Fires feathers when enemies are near\nAn exceptionally agile yoyo");
ItemID.Sets.Yoyo[item.type] = true;
ItemID.Sets.GamepadExtraRange[item.type] = 15;
ItemID.Sets.GamepadSmartQuickReach[item.type] = true;
}
public override void SetDefaults()
{
item.CloneDefaults(ItemID.Valor);
item.width = 28;
item.height = 28;
item.melee = true;
item.damage = 20;
item.knockBack = 4f;
item.useTime = 22;
item.useAnimation = 22;
item.autoReuse = true;
item.useStyle = 5;
item.UseSound = SoundID.Item1;
item.channel = true;
item.melee = true;
item.knockBack = 4;
item.value = Item.buyPrice(0, 4, 0, 0);
item.noUseGraphic = true;
item.noMelee = true;
item.shoot = ModContent.ProjectileType<AirSpinnerYoyo>();
item.shootSpeed = 14f;
item.rare = 3;
item.autoReuse = false;
item.shoot = ModContent.ProjectileType<AirSpinnerProjectile>();
ItemID.Sets.Yoyo[item.type] = true;
item.value = Item.buyPrice(gold: 4);
}
public override void AddRecipes()
+18 -7
View File
@@ -11,23 +11,34 @@ namespace CalamityMod.Items.Weapons.Melee
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Aorta");
Tooltip.SetDefault("An exceptionally agile yoyo");
ItemID.Sets.Yoyo[item.type] = true;
ItemID.Sets.GamepadExtraRange[item.type] = 15;
ItemID.Sets.GamepadSmartQuickReach[item.type] = true;
}
public override void SetDefaults()
{
item.CloneDefaults(ItemID.Valor);
item.width = 30;
item.height = 26;
item.melee = true;
item.damage = 25;
item.knockBack = 4.25f;
item.useTime = 22;
item.useAnimation = 22;
item.autoReuse = true;
item.useStyle = 5;
item.UseSound = SoundID.Item1;
item.channel = true;
item.melee = true;
item.knockBack = 4.25f;
item.value = Item.buyPrice(0, 4, 0, 0);
item.noUseGraphic = true;
item.noMelee = true;
item.shoot = ModContent.ProjectileType<AortaYoyo>();
item.shootSpeed = 8f;
item.rare = 3;
item.autoReuse = false;
item.shoot = ModContent.ProjectileType<AortaProjectile>();
ItemID.Sets.Yoyo[item.type] = true;
item.value = Item.buyPrice(gold: 4);
}
public override void AddRecipes()
+18 -8
View File
@@ -12,26 +12,36 @@ namespace CalamityMod.Items.Weapons.Melee
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Azathoth");
Tooltip.SetDefault("Destroy the universe in the blink of an eye\n" +
"Fires cosmic orbs that blast nearby enemies with lasers");
Tooltip.SetDefault("Fires cosmic orbs that blast nearby enemies with lasers\nAn exceptionally agile yoyo\n'Destroy the universe in the blink of an eye'");
ItemID.Sets.Yoyo[item.type] = true;
ItemID.Sets.GamepadExtraRange[item.type] = 15;
ItemID.Sets.GamepadSmartQuickReach[item.type] = true;
}
public override void SetDefaults()
{
item.CloneDefaults(ItemID.Kraken);
item.width = 30;
item.height = 26;
item.melee = true;
item.damage = 200;
item.knockBack = 6f;
item.useTime = 20;
item.useAnimation = 20;
item.autoReuse = true;
item.useStyle = 5;
item.UseSound = SoundID.Item1;
item.channel = true;
item.melee = true;
item.knockBack = 6f;
item.value = Item.buyPrice(5, 0, 0, 0);
item.noUseGraphic = true;
item.noMelee = true;
item.shoot = ModContent.ProjectileType<AzathothYoyo>();
item.shootSpeed = 16f;
item.rare = 10;
item.autoReuse = true;
item.shoot = ModContent.ProjectileType<AzathothProjectile>();
item.Calamity().postMoonLordRarity = 16;
ItemID.Sets.Yoyo[item.type] = true;
item.value = Item.buyPrice(platinum: 5);
}
public override void AddRecipes()
+21 -11
View File
@@ -11,24 +11,34 @@ namespace CalamityMod.Items.Weapons.Melee
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Chaotrix");
Tooltip.SetDefault("Explodes on enemy hits");
Tooltip.SetDefault("Explodes on enemy hits\nAn exceptionally agile yoyo");
ItemID.Sets.Yoyo[item.type] = true;
ItemID.Sets.GamepadExtraRange[item.type] = 15;
ItemID.Sets.GamepadSmartQuickReach[item.type] = true;
}
public override void SetDefaults()
{
item.CloneDefaults(ItemID.Yelets);
item.damage = 110;
item.width = 30;
item.height = 26;
item.melee = true;
item.damage = 88; // 110 pre-nerf
item.knockBack = 4f;
item.useTime = 22;
item.useAnimation = 22;
item.useStyle = 5;
item.channel = true;
item.melee = true;
item.knockBack = 4f;
item.value = Item.buyPrice(0, 80, 0, 0);
item.rare = 8;
item.autoReuse = true;
item.shoot = ModContent.ProjectileType<ChaotrixProjectile>();
ItemID.Sets.Yoyo[item.type] = true;
item.useStyle = 5;
item.UseSound = SoundID.Item1;
item.channel = true;
item.noUseGraphic = true;
item.noMelee = true;
item.shoot = ModContent.ProjectileType<ChaotrixYoyo>();
item.shootSpeed = 14f;
item.rare = 8;
item.value = Item.buyPrice(gold: 80);
}
public override void AddRecipes()
+19 -9
View File
@@ -12,23 +12,33 @@ namespace CalamityMod.Items.Weapons.Melee
{
DisplayName.SetDefault("Cnidarian");
Tooltip.SetDefault("Fires a seashell when enemies are near");
ItemID.Sets.Yoyo[item.type] = true;
ItemID.Sets.GamepadExtraRange[item.type] = 15;
ItemID.Sets.GamepadSmartQuickReach[item.type] = true;
}
public override void SetDefaults()
{
item.CloneDefaults(ItemID.CorruptYoyo);
item.width = 30;
item.height = 26;
item.melee = true;
item.damage = 13;
item.knockBack = 3f;
item.useTime = 25;
item.useAnimation = 25;
item.useStyle = 5;
item.channel = true;
item.melee = true;
item.knockBack = 3f;
item.value = Item.buyPrice(0, 2, 0, 0);
item.rare = 2;
item.autoReuse = true;
item.shoot = ModContent.ProjectileType<CnidarianProjectile>();
ItemID.Sets.Yoyo[item.type] = true;
item.useStyle = 5;
item.UseSound = SoundID.Item1;
item.channel = true;
item.noUseGraphic = true;
item.noMelee = true;
item.shoot = ModContent.ProjectileType<CnidarianYoyo>();
item.shootSpeed = 10f;
item.rare = 2;
item.value = Item.buyPrice(gold: 2);
}
public override void AddRecipes()
-1
View File
@@ -50,7 +50,6 @@ namespace CalamityMod.Items.Weapons.Melee
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ModContent.ItemType<ElementalShortsword>());
recipe.AddIngredient(ModContent.ItemType<RuinousSoul>(), 5);
recipe.AddIngredient(ModContent.ItemType<ExodiumClusterOre>(), 15);
recipe.AddTile(TileID.LunarCraftingStation);
+20 -11
View File
@@ -11,26 +11,35 @@ namespace CalamityMod.Items.Weapons.Melee
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Lacerator");
Tooltip.SetDefault("Enemies that are hit by the yoyo will have their life drained\n" +
"Someone thought this was a viable weapon against DoG at one point lol");
Tooltip.SetDefault("Enemies that are hit by the yoyo will have their life drained\nAn exceptionally agile yoyo\n'Someone thought this was a viable weapon against DoG at one point lol'");
ItemID.Sets.Yoyo[item.type] = true;
ItemID.Sets.GamepadExtraRange[item.type] = 15;
ItemID.Sets.GamepadSmartQuickReach[item.type] = true;
}
public override void SetDefaults()
{
item.CloneDefaults(ItemID.TheEyeOfCthulhu);
item.width = 30;
item.height = 26;
item.melee = true;
item.damage = 150;
item.knockBack = 7f;
item.useTime = 20;
item.useAnimation = 20;
item.useStyle = 5;
item.channel = true;
item.melee = true;
item.knockBack = 7f;
item.value = Item.buyPrice(1, 40, 0, 0);
item.rare = 10;
item.autoReuse = true;
item.shoot = ModContent.ProjectileType<LaceratorProjectile>();
item.useStyle = 5;
item.UseSound = SoundID.Item1;
item.channel = true;
item.noUseGraphic = true;
item.noMelee = true;
item.shoot = ModContent.ProjectileType<LaceratorYoyo>();
item.shootSpeed = 16f;
item.rare = 10;
item.Calamity().postMoonLordRarity = 13;
ItemID.Sets.Yoyo[item.type] = true;
item.value = Item.buyPrice(platinum: 1, gold: 40);
}
public override void AddRecipes()
+2 -2
View File
@@ -13,7 +13,7 @@ namespace CalamityMod.Items.Weapons.Melee
public override void SetStaticDefaults()
{
DisplayName.SetDefault("The Oracle");
Tooltip.SetDefault("Emits an aura of red lightning\nFires auric orbs when supercharged\nHitting enemies charges the yoyo\n'Gaze into the past, the present, the future... and the circumstances of your inevitable demise'");
Tooltip.SetDefault("Emits an aura of red lightning which charges up when hitting enemies\nFires auric orbs when supercharged\nAn exceptionally agile yoyo\n'Gaze into the past, the present, the future... and the circumstances of your inevitable demise'");
ItemID.Sets.Yoyo[item.type] = true;
ItemID.Sets.GamepadExtraRange[item.type] = 15;
ItemID.Sets.GamepadSmartQuickReach[item.type] = true;
@@ -41,7 +41,7 @@ namespace CalamityMod.Items.Weapons.Melee
item.rare = 10;
item.Calamity().postMoonLordRarity = 21;
item.value = Item.buyPrice(2, 50, 0, 0);
item.value = Item.buyPrice(platinum: 2, gold: 50);
}
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
+17 -9
View File
@@ -12,25 +12,33 @@ namespace CalamityMod.Items.Weapons.Melee
{
DisplayName.SetDefault("Quagmire");
Tooltip.SetDefault("Fires spore clouds");
ItemID.Sets.Yoyo[item.type] = true;
ItemID.Sets.GamepadExtraRange[item.type] = 15;
ItemID.Sets.GamepadSmartQuickReach[item.type] = true;
}
public override void SetDefaults()
{
item.CloneDefaults(ItemID.HelFire);
item.width = 30;
item.height = 36;
item.melee = true;
item.damage = 52;
item.knockBack = 3.5f;
item.useTime = 22;
item.useAnimation = 22;
item.useStyle = 5;
item.channel = true;
item.melee = true;
item.knockBack = 3.5f;
item.value = Item.buyPrice(0, 60, 0, 0);
item.rare = 7;
item.autoReuse = true;
item.shoot = ModContent.ProjectileType<QuagmireProjectile>();
ItemID.Sets.Yoyo[item.type] = true;
item.useStyle = 5;
item.UseSound = SoundID.Item1;
item.channel = true;
item.noUseGraphic = true;
item.noMelee = true;
item.shoot = ModContent.ProjectileType<QuagmireYoyo>();
item.shootSpeed = 10f;
item.rare = 7;
item.value = Item.buyPrice(gold: 60);
}
public override void AddRecipes()
+19 -9
View File
@@ -12,23 +12,33 @@ namespace CalamityMod.Items.Weapons.Melee
{
DisplayName.SetDefault("Shimmerspark");
Tooltip.SetDefault("Fires stars when enemies are near");
ItemID.Sets.Yoyo[item.type] = true;
ItemID.Sets.GamepadExtraRange[item.type] = 15;
ItemID.Sets.GamepadSmartQuickReach[item.type] = true;
}
public override void SetDefaults()
{
item.CloneDefaults(ItemID.Chik);
item.width = 50;
item.height = 36;
item.melee = true;
item.damage = 36;
item.knockBack = 3.5f;
item.useTime = 25;
item.useAnimation = 25;
item.useStyle = 5;
item.channel = true;
item.melee = true;
item.knockBack = 3.5f;
item.value = Item.buyPrice(0, 36, 0, 0);
item.rare = 5;
item.autoReuse = true;
item.shoot = ModContent.ProjectileType<ShimmersparkProjectile>();
ItemID.Sets.Yoyo[item.type] = true;
item.useStyle = 5;
item.UseSound = SoundID.Item1;
item.channel = true;
item.noUseGraphic = true;
item.noMelee = true;
item.shoot = ModContent.ProjectileType<ShimmersparkYoyo>();
item.shootSpeed = 12f;
item.rare = 5;
item.value = Item.buyPrice(gold: 36);
}
public override void AddRecipes()
+19 -9
View File
@@ -10,25 +10,35 @@ namespace CalamityMod.Items.Weapons.Melee
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Solar Flare");
Tooltip.SetDefault("Emits large holy explosions on hit");
Tooltip.SetDefault("Emits large holy explosions on hit\nAn exceptionally agile yoyo");
ItemID.Sets.Yoyo[item.type] = true;
ItemID.Sets.GamepadExtraRange[item.type] = 15;
ItemID.Sets.GamepadSmartQuickReach[item.type] = true;
}
public override void SetDefaults()
{
item.CloneDefaults(ItemID.TheEyeOfCthulhu);
item.width = 40;
item.height = 38;
item.melee = true;
item.damage = 60;
item.knockBack = 7.5f;
item.useTime = 20;
item.useAnimation = 20;
item.useStyle = 5;
item.channel = true;
item.melee = true;
item.knockBack = 7.5f;
item.value = Item.buyPrice(1, 20, 0, 0);
item.rare = 10;
item.autoReuse = true;
item.useStyle = 5;
item.UseSound = SoundID.Item1;
item.channel = true;
item.noUseGraphic = true;
item.noMelee = true;
item.shoot = ModContent.ProjectileType<SolarFlareYoyo>();
item.shootSpeed = 16f;
item.rare = 10;
item.Calamity().postMoonLordRarity = 12;
ItemID.Sets.Yoyo[item.type] = true;
item.value = Item.buyPrice(platinum: 1, gold: 20);
}
}
}
+19 -9
View File
@@ -11,23 +11,33 @@ namespace CalamityMod.Items.Weapons.Melee
{
DisplayName.SetDefault("Oblivion");
Tooltip.SetDefault("Fires brimstone lasers when enemies are near");
ItemID.Sets.Yoyo[item.type] = true;
ItemID.Sets.GamepadExtraRange[item.type] = 15;
ItemID.Sets.GamepadSmartQuickReach[item.type] = true;
}
public override void SetDefaults()
{
item.CloneDefaults(ItemID.TheEyeOfCthulhu);
item.width = 28;
item.height = 38;
item.melee = true;
item.damage = 41;
item.knockBack = 4f;
item.useTime = 22;
item.useAnimation = 22;
item.useStyle = 5;
item.channel = true;
item.melee = true;
item.knockBack = 4f;
item.value = Item.buyPrice(0, 60, 0, 0);
item.rare = 7;
item.autoReuse = true;
item.shoot = ModContent.ProjectileType<TheEyeofCalamitasProjectile>();
ItemID.Sets.Yoyo[item.type] = true;
item.useStyle = 5;
item.UseSound = SoundID.Item1;
item.channel = true;
item.noUseGraphic = true;
item.noMelee = true;
item.shoot = ModContent.ProjectileType<OblivionYoyo>();
item.shootSpeed = 14f;
item.rare = 7;
item.value = Item.buyPrice(gold: 60);
}
}
}
+19 -9
View File
@@ -12,23 +12,33 @@ namespace CalamityMod.Items.Weapons.Melee
{
DisplayName.SetDefault("The God's Gambit");
Tooltip.SetDefault("Fires a stream of slime when enemies are near");
ItemID.Sets.Yoyo[item.type] = true;
ItemID.Sets.GamepadExtraRange[item.type] = 15;
ItemID.Sets.GamepadSmartQuickReach[item.type] = true;
}
public override void SetDefaults()
{
item.CloneDefaults(3291);
item.width = 40;
item.height = 26;
item.melee = true;
item.damage = 28;
item.knockBack = 3.5f;
item.useTime = 21;
item.useAnimation = 21;
item.useStyle = 5;
item.channel = true;
item.melee = true;
item.knockBack = 3.5f;
item.value = Item.buyPrice(0, 12, 0, 0);
item.rare = 4;
item.autoReuse = true;
item.shoot = ModContent.ProjectileType<TheGodsGambitProjectile>();
ItemID.Sets.Yoyo[item.type] = true;
item.useStyle = 5;
item.UseSound = SoundID.Item1;
item.channel = true;
item.noUseGraphic = true;
item.noMelee = true;
item.shoot = ModContent.ProjectileType<GodsGambitYoyo>();
item.shootSpeed = 10f;
item.rare = 4;
item.value = Item.buyPrice(gold: 12);
}
public override void AddRecipes()
+21 -12
View File
@@ -10,26 +10,35 @@ namespace CalamityMod.Items.Weapons.Melee
public override void SetStaticDefaults()
{
DisplayName.SetDefault("The Microwave");
//Tooltip.SetDefault("MMMMMMMMMMMMMM, 13th letter of the alphabet moments");
Tooltip.SetDefault("Baking enemies in the astral infection\n\n" +
"Summons an aura around the yoyo that damages nearby enemies");
//Tooltip.SetDefault("MMMMMMMMMMMMM");
Tooltip.SetDefault("Fries nearby enemies with radiation\nAn exceptionally agile yoyo\n'Cooking, Astral Infection style'");
ItemID.Sets.Yoyo[item.type] = true;
ItemID.Sets.GamepadExtraRange[item.type] = 15;
ItemID.Sets.GamepadSmartQuickReach[item.type] = true;
}
public override void SetDefaults()
{
item.CloneDefaults(ItemID.TheEyeOfCthulhu);
item.width = 34;
item.height = 34;
item.melee = true;
item.damage = 80;
item.knockBack = 3f;
item.useTime = 22;
item.useAnimation = 22;
item.useStyle = 5;
item.channel = true;
item.melee = true;
item.knockBack = 3f;
item.value = Item.buyPrice(0, 95, 0, 0);
item.rare = 9;
item.autoReuse = true;
item.shoot = ModContent.ProjectileType<TheMicrowaveProj>();
ItemID.Sets.Yoyo[item.type] = true;
item.useStyle = 5;
item.UseSound = SoundID.Item1;
item.channel = true;
item.noUseGraphic = true;
item.noMelee = true;
item.shoot = ModContent.ProjectileType<MicrowaveYoyo>();
item.shootSpeed = 14f;
item.rare = 9;
item.value = Item.buyPrice(gold: 95);
}
}
}
+20 -10
View File
@@ -10,25 +10,35 @@ namespace CalamityMod.Items.Weapons.Melee
public override void SetStaticDefaults()
{
DisplayName.SetDefault("The Obliterator");
Tooltip.SetDefault("Fires death lasers when enemies are near");
Tooltip.SetDefault("Ruins nearby enemies with death lasers\nAn exceptionally agile yoyo\n");
ItemID.Sets.Yoyo[item.type] = true;
ItemID.Sets.GamepadExtraRange[item.type] = 15;
ItemID.Sets.GamepadSmartQuickReach[item.type] = true;
}
public override void SetDefaults()
{
item.CloneDefaults(ItemID.TheEyeOfCthulhu);
item.damage = 240;
item.width = 42;
item.height = 40;
item.melee = true;
item.damage = 370;
item.knockBack = 7.5f;
item.useTime = 20;
item.useAnimation = 20;
item.useStyle = 5;
item.channel = true;
item.melee = true;
item.knockBack = 7.5f;
item.value = Item.buyPrice(1, 40, 0, 0);
item.rare = 10;
item.autoReuse = true;
item.useStyle = 5;
item.UseSound = SoundID.Item1;
item.channel = true;
item.noUseGraphic = true;
item.noMelee = true;
item.shoot = ModContent.ProjectileType<TheObliteratorYoyo>();
item.shootSpeed = 16f;
item.rare = 10;
item.Calamity().postMoonLordRarity = 13;
ItemID.Sets.Yoyo[item.type] = true;
item.value = Item.buyPrice(platinum: 1, gold: 40);
}
}
}
+19 -9
View File
@@ -11,23 +11,33 @@ namespace CalamityMod.Items.Weapons.Melee
{
DisplayName.SetDefault("Pandemic");
Tooltip.SetDefault("Fires plague seekers when enemies are near");
ItemID.Sets.Yoyo[item.type] = true;
ItemID.Sets.GamepadExtraRange[item.type] = 15;
ItemID.Sets.GamepadSmartQuickReach[item.type] = true;
}
public override void SetDefaults()
{
item.CloneDefaults(ItemID.TheEyeOfCthulhu);
item.width = 30;
item.height = 32;
item.melee = true;
item.damage = 100;
item.knockBack = 2.5f;
item.useTime = 22;
item.useAnimation = 22;
item.useStyle = 5;
item.channel = true;
item.melee = true;
item.knockBack = 2.5f;
item.value = Item.buyPrice(0, 80, 0, 0);
item.rare = 8;
item.autoReuse = true;
item.shoot = ModContent.ProjectileType<ThePlaguebringerYoyo>();
ItemID.Sets.Yoyo[item.type] = true;
item.useStyle = 5;
item.UseSound = SoundID.Item1;
item.channel = true;
item.noUseGraphic = true;
item.noMelee = true;
item.shoot = ModContent.ProjectileType<PandemicYoyo>();
item.shootSpeed = 14f;
item.rare = 8;
item.value = Item.buyPrice(gold: 80);
}
}
}
+18 -7
View File
@@ -11,25 +11,36 @@ namespace CalamityMod.Items.Weapons.Melee
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Verdant");
Tooltip.SetDefault("Fires crystal leafs when enemies are near");
Tooltip.SetDefault("Fires crystal leaves when enemies are near\nAn exceptionally agile yoyo");
ItemID.Sets.Yoyo[item.type] = true;
ItemID.Sets.GamepadExtraRange[item.type] = 15;
ItemID.Sets.GamepadSmartQuickReach[item.type] = true;
}
public override void SetDefaults()
{
item.CloneDefaults(ItemID.Kraken);
item.width = 30;
item.height = 30;
item.melee = true;
item.damage = 218;
item.knockBack = 6f;
item.useTime = 22;
item.useAnimation = 22;
item.autoReuse = true;
item.useStyle = 5;
item.UseSound = SoundID.Item1;
item.channel = true;
item.melee = true;
item.knockBack = 6f;
item.value = Item.buyPrice(1, 20, 0, 0);
item.noUseGraphic = true;
item.noMelee = true;
item.shoot = ModContent.ProjectileType<VerdantYoyo>();
item.shootSpeed = 16f;
item.rare = 10;
item.autoReuse = true;
item.shoot = ModContent.ProjectileType<VerdantProjectile>();
item.Calamity().postMoonLordRarity = 12;
ItemID.Sets.Yoyo[item.type] = true;
item.value = Item.buyPrice(platinum: 1, gold: 20);
}
public override void AddRecipes()
+18 -11
View File
@@ -12,26 +12,33 @@ namespace CalamityMod.Items.Weapons.Melee
{
DisplayName.SetDefault("Riptide");
Tooltip.SetDefault("Sprays a spiral of aqua streams in random directions");
ItemID.Sets.Yoyo[item.type] = true;
ItemID.Sets.GamepadExtraRange[item.type] = 15;
ItemID.Sets.GamepadSmartQuickReach[item.type] = true;
}
public override void SetDefaults()
{
item.CloneDefaults(ItemID.TheEyeOfCthulhu);
item.damage = 18;
item.width = 30;
item.height = 44;
item.value = Item.buyPrice(0, 2, 0, 0);
item.rare = 2;
item.knockBack = 1f;
item.channel = true;
item.melee = true;
item.useStyle = 5;
item.useAnimation = 25;
item.damage = 18;
item.knockBack = 1f;
item.useTime = 25;
item.shoot = ModContent.ProjectileType<WhirlpoolProjectile>();
item.shootSpeed = 18f;
item.useAnimation = 25;
item.autoReuse = true;
item.useStyle = 5;
item.UseSound = SoundID.Item1;
ItemID.Sets.Yoyo[item.type] = true;
item.channel = true;
item.noUseGraphic = true;
item.noMelee = true;
item.shoot = ModContent.ProjectileType<RiptideYoyo>();
item.shootSpeed = 18f;
item.rare = 2;
item.value = Item.buyPrice(gold: 2);
}
public override void AddRecipes()
+19 -9
View File
@@ -9,26 +9,36 @@ namespace CalamityMod.Items.Weapons.Melee
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("YinYo");
DisplayName.SetDefault("Yin-Yo");
Tooltip.SetDefault("Fires light or dark shards when enemies are near\n" +
"Light shards fly up and down while dark shards fly left and right");
ItemID.Sets.Yoyo[item.type] = true;
ItemID.Sets.GamepadExtraRange[item.type] = 15;
ItemID.Sets.GamepadSmartQuickReach[item.type] = true;
}
public override void SetDefaults()
{
item.CloneDefaults(ItemID.Chik);
item.width = 26;
item.height = 24;
item.melee = true;
item.damage = 34;
item.knockBack = 3.5f;
item.useTime = 25;
item.useAnimation = 25;
item.useStyle = 5;
item.channel = true;
item.melee = true;
item.knockBack = 3.5f;
item.value = Item.buyPrice(0, 36, 0, 0);
item.rare = 5;
item.autoReuse = true;
item.useStyle = 5;
item.UseSound = SoundID.Item1;
item.channel = true;
item.noUseGraphic = true;
item.noMelee = true;
item.shoot = ModContent.ProjectileType<YinYoyo>();
ItemID.Sets.Yoyo[item.type] = true;
item.shootSpeed = 12f;
item.rare = 5;
item.value = Item.buyPrice(gold: 36);
}
public override void AddRecipes()
+69
View File
@@ -0,0 +1,69 @@
using CalamityMod.Items.Materials;
using CalamityMod.Projectiles.Rogue;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Weapons.Rogue
{
public class ShockGrenade : RogueWeapon
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Shock Grenade");
Tooltip.SetDefault("Throws a grenade that explodes into a burst of lightning\n" +
"Stealth strikes cause the grenade to leave an electrifying aura when it explodes");
}
public override void SafeSetDefaults()
{
item.width = 14;
item.damage = 100;
item.noMelee = true;
item.noUseGraphic = true;
item.consumable = true;
item.useAnimation = 18;
item.useStyle = 1;
item.useTime = 18;
item.knockBack = 1f;
item.autoReuse = true;
item.height = 30;
item.maxStack = 999;
item.value = Item.buyPrice(0, 1, 0, 0);
item.rare = 8;
item.shoot = ModContent.ProjectileType<ShockGrenadeProjectile>();
item.shootSpeed = 7.5f;
item.Calamity().rogue = true;
}
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.Calamity().StealthStrikeAvailable())
{
int p = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, 0f, 0f);
Main.projectile[p].Calamity().stealthStrike = true;
return false;
}
return true;
}
public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI)
{
Vector2 origin = new Vector2(item.width / 2, item.height / 2);
spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Items/Weapons/Rogue/ShockGrenadeGlow"), item.Center - Main.screenPosition, null, Color.White, rotation, origin, 1f, SpriteEffects.None, 0f);
}
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ItemID.Grenade, 10);
recipe.AddIngredient(ItemID.MartianConduitPlating, 2);
recipe.AddIngredient(ItemID.Nanites, 1);
recipe.AddTile(TileID.WorkBenches);
recipe.SetResult(this, 10);
recipe.AddRecipe();
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 367 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 172 B

+6
View File
@@ -5,6 +5,7 @@ using System;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using CalamityMod.Items.Weapons.Magic;
namespace CalamityMod.NPCs.Abyss
{
@@ -209,5 +210,10 @@ namespace CalamityMod.NPCs.Abyss
}
}
}
public override void NPCLoot()
{
DropHelper.DropItemCondition(npc, ModContent.ItemType<AbyssShocker>(), NPC.downedBoss3, Main.expertMode ? 40 : 50, 1, 1);
}
}
}
+2
View File
@@ -3,6 +3,7 @@ using CalamityMod.Items.Accessories;
using CalamityMod.Items.Materials;
using CalamityMod.Items.Placeables.Banners;
using CalamityMod.Items.Weapons.Ranged;
using CalamityMod.Items.Weapons.Magic;
using CalamityMod.World;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
@@ -194,6 +195,7 @@ namespace CalamityMod.NPCs.Abyss
public override void NPCLoot()
{
DropHelper.DropItemCondition(npc, ModContent.ItemType<AbyssShocker>(), NPC.downedBoss3, 10, 1, 1);
if (Main.rand.NextBool(1000000) && CalamityWorld.revenge)
{
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ModContent.ItemType<HalibutCannon>());
+23
View File
@@ -98,6 +98,7 @@ namespace CalamityMod.NPCs
public int silvaStun = 0;
public int webbed = 0;
public int slowed = 0;
public int electrified = 0;
public int yellowCandle = 0;
public int pearlAura = 0;
public int wCleave = 0;
@@ -544,6 +545,10 @@ namespace CalamityMod.NPCs
ApplyDPSDebuff(dFlames, 2500, 500, ref npc.lifeRegen, ref damage);
ApplyDPSDebuff(bBlood, 50, 10, ref npc.lifeRegen, ref damage);
ApplyDPSDebuff(sulphurPoison, 180, 36, ref npc.lifeRegen, ref damage);
if (npc.velocity.X == 0)
ApplyDPSDebuff(electrified, 4, 2, ref npc.lifeRegen, ref damage);
else
ApplyDPSDebuff(electrified, 16, 16, ref npc.lifeRegen, ref damage);
}
public void ApplyDPSDebuff(int debuff, int lifeRegenValue, int damageValue, ref int lifeRegen, ref int damage)
@@ -611,6 +616,7 @@ namespace CalamityMod.NPCs
npc.buffImmune[ModContent.BuffType<TimeSlow>()] = true;
npc.buffImmune[BuffID.Webbed] = true;
npc.buffImmune[BuffID.Slow] = true;
npc.buffImmune[BuffID.Electrified] = true;
}
if (DestroyerIDs.Contains(npc.type) || npc.type == NPCID.DD2EterniaCrystal || npc.townNPC)
@@ -2121,6 +2127,8 @@ namespace CalamityMod.NPCs
webbed--;
if (slowed > 0)
slowed--;
if (electrified > 0)
electrified--;
if (yellowCandle > 0)
yellowCandle--;
if (pearlAura > 0)
@@ -3189,6 +3197,21 @@ namespace CalamityMod.NPCs
}
}
}
if (electrified > 0)
{
if (Main.rand.Next(5) < 4)
{
int dust = Dust.NewDust(npc.position - new Vector2(2f, 2f), npc.width + 4, npc.height + 4, 132, npc.velocity.X * 0.4f, npc.velocity.Y * 0.4f, 0, default, 1f);
Main.dust[dust].noGravity = true;
Main.dust[dust].velocity *= 1.1f;
Main.dust[dust].velocity.Y += 0.25f;
if (Main.rand.NextBool(2))
{
Main.dust[dust].noGravity = false;
Main.dust[dust].scale *= 0.5f;
}
}
}
if (gState > 0 || eFreeze > 0)
{
+12
View File
@@ -1667,6 +1667,18 @@ namespace CalamityMod.NPCs
DropHelper.DropItemCondition(npc, ModContent.ItemType<DarksunFragment>(), CalamityWorld.downedBuffedMothron, Main.expertMode ? 0.06f : 0.04f, 1, 1);
break;
case NPCID.MartianOfficer:
DropHelper.DropItemChance(npc, ModContent.ItemType<ShockGrenade>(), Main.expertMode ? 3 : 4, 3, 8);
break;
case NPCID.BrainScrambler:
case NPCID.GrayGrunt:
case NPCID.GigaZapper:
case NPCID.MartianEngineer:
case NPCID.RayGunner:
case NPCID.ScutlixRider:
DropHelper.DropItemChance(npc, ModContent.ItemType<ShockGrenade>(), Main.expertMode ? 4 : 5, 1, 4);
break;
default:
break;
}
+160
View File
@@ -0,0 +1,160 @@
using Microsoft.Xna.Framework;
using System;
using System.Collections.Generic;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Magic
{
public class LightningArc : ModProjectile
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Lightning Arc");
}
public override void SetDefaults()
{
projectile.width = 8;
projectile.height = 8;
projectile.alpha = 255;
projectile.friendly = true;
projectile.tileCollide = false;
projectile.ignoreWater = true;
projectile.magic = true;
projectile.timeLeft = 20;
projectile.penetrate = 6;
projectile.tileCollide = true;
}
HashSet<NPC> shockedbefore = new HashSet<NPC>();
int prevX = 0;
public override void AI()
{
//projectile.alpha exists
if (projectile.localAI[0] == 0f)
{
AdjustMagnitude(ref projectile.velocity);
projectile.localAI[0] = 1f;
}
Vector2 move = Vector2.Zero;
float distance = 160f;
bool target = false;
NPC npc = null;
bool pastNPC = false;
if (projectile.timeLeft < 18) {
for (int k = 0; k < 200; k++)
{
if (Main.npc[k].active && !Main.npc[k].dontTakeDamage && !Main.npc[k].friendly && Main.npc[k].lifeMax > 5 && !shockedbefore.Contains(Main.npc[k]))
{
Vector2 newMove = Main.npc[k].Center - (projectile.velocity + projectile.Center);
float distanceTo = (float)Math.Sqrt(newMove.X * newMove.X + newMove.Y * newMove.Y);
if (distanceTo < distance)
{
move = newMove;
distance = distanceTo;
target = true;
npc = Main.npc[k];
}
}
}
}
//if not found, lokk thru npcs that have been shocked before
if (!target) {
foreach (NPC pastnpc in shockedbefore) {
Vector2 newMove = pastnpc.Center -(projectile.velocity + projectile.Center);
float distanceTo = (float)Math.Sqrt(newMove.X * newMove.X + newMove.Y * newMove.Y);
if (distanceTo < distance)
{
move = newMove;
distance = distanceTo;
target = true;
npc = pastnpc;
pastNPC = true;
}
}
}
// Main.dust[dust].velocity /= 2f;
Vector2 current = projectile.Center;
if (target)
{
shockedbefore.Add(npc);
npc.HitEffect(0, projectile.damage);
//AdjustMagnitude(ref move);
//AdjustMagnitude(ref projectile.velocity);
//projectile.velocity = (10 * projectile.velocity + move) / 11f;
move+= new Vector2(Main.rand.Next(-10, 10), Main.rand.Next(-10, 10))*distance/30;
if (pastNPC) {
prevX++;
move += new Vector2(Main.rand.Next(-10, 10), Main.rand.Next(-10, 10)) * prevX;
}
}
else {
move = (projectile.velocity+ new Vector2(Main.rand.Next(-10, 10), Main.rand.Next(-10, 10)))*5;
}
for (int i = 0; i < 20; i++)
{
int dust = Dust.NewDust(current, projectile.width, projectile.height, 20, 0, 0);
Main.dust[dust].velocity = new Vector2(0);
current += move / 20f;
}
projectile.position = current;
/*int tx = (int)(projectile.position.X / 16f);
int ty = (int)(projectile.position.Y / 16f);
if (tx < 0)
{
tx = 0;
}
if (tx > Main.maxTilesX)
{
tx = Main.maxTilesX;
}
if (ty < 0)
{
ty = 0;
}
if (ty > Main.maxTilesY)
{
ty = Main.maxTilesY;
}
if (Main.tile[tx, ty] != null && Main.tileSolid[(int)Main.tile[tx,ty].type] && Main.tile[tx, ty].wall == 0)
{
projectile.timeLeft -= 12;
}*/
}
public override bool OnTileCollide(Vector2 oldVelocity)
{
projectile.velocity = oldVelocity;
projectile.timeLeft -= 12;
return false;
}
private void AdjustMagnitude(ref Vector2 vector)
{
float magnitude = (float)Math.Sqrt(vector.X * vector.X + vector.Y * vector.Y);
if (magnitude > 6f)
{
vector *= 6f / magnitude;
}
}
public override void OnHitPvp(Player target, int damage, bool crit)
{
if (Main.rand.NextBool(3))
{
target.AddBuff(BuffID.Electrified, 300);
}
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 251 B

+1 -3
View File
@@ -1,7 +1,5 @@
using CalamityMod.Buffs.DamageOverTime;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -14,7 +12,7 @@ namespace CalamityMod.Projectiles.Melee
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Microwave");
DisplayName.SetDefault("Microwave Radiation");
}
public override void SetDefaults()
@@ -7,25 +7,29 @@ using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Melee.Yoyos
{
public class AirSpinnerProjectile : ModProjectile
public class AirSpinnerYoyo : ModProjectile
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Air Spinner");
ProjectileID.Sets.YoyosLifeTimeMultiplier[projectile.type] = 6f;
ProjectileID.Sets.YoyosMaximumRange[projectile.type] = 300f;
ProjectileID.Sets.YoyosTopSpeed[projectile.type] = 14f;
ProjectileID.Sets.TrailCacheLength[projectile.type] = 4;
ProjectileID.Sets.TrailingMode[projectile.type] = 0;
}
public override void SetDefaults()
{
projectile.CloneDefaults(ProjectileID.Valor);
projectile.aiStyle = 99;
projectile.width = 16;
projectile.scale = 1.05f;
projectile.height = 16;
projectile.penetrate = 7;
projectile.extraUpdates = 1;
projectile.scale = 1.05f;
projectile.friendly = true;
projectile.melee = true;
ProjectileID.Sets.TrailCacheLength[projectile.type] = 4;
ProjectileID.Sets.TrailingMode[projectile.type] = 0;
aiType = ProjectileID.Valor;
projectile.penetrate = -1;
projectile.extraUpdates = 1;
}
public override void AI()
@@ -79,8 +83,7 @@ namespace CalamityMod.Projectiles.Melee.Yoyos
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
{
Texture2D tex = Main.projectileTexture[projectile.type];
spriteBatch.Draw(tex, projectile.Center - Main.screenPosition, null, projectile.GetAlpha(lightColor), projectile.rotation, tex.Size() / 2f, projectile.scale, SpriteEffects.None, 0f);
CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1);
return false;
}
}
File renamed without changes.

Before

Width:  |  Height:  |  Size: 309 B

After

Width:  |  Height:  |  Size: 309 B

@@ -1,35 +1,38 @@
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Melee.Yoyos
{
public class AortaProjectile : ModProjectile
public class AortaYoyo : ModProjectile
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Aorta");
ProjectileID.Sets.YoyosLifeTimeMultiplier[projectile.type] = 11f;
ProjectileID.Sets.YoyosMaximumRange[projectile.type] = 220f;
ProjectileID.Sets.YoyosTopSpeed[projectile.type] = 14f;
ProjectileID.Sets.TrailCacheLength[projectile.type] = 4;
ProjectileID.Sets.TrailingMode[projectile.type] = 0;
}
public override void SetDefaults()
{
projectile.CloneDefaults(ProjectileID.Valor);
projectile.aiStyle = 99;
projectile.width = 16;
projectile.height = 16;
projectile.penetrate = 7;
projectile.extraUpdates = 1;
projectile.scale = 1f;
projectile.friendly = true;
projectile.melee = true;
ProjectileID.Sets.TrailCacheLength[projectile.type] = 4;
ProjectileID.Sets.TrailingMode[projectile.type] = 0;
aiType = ProjectileID.Valor;
projectile.penetrate = -1;
projectile.extraUpdates = 1;
}
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
{
Texture2D tex = Main.projectileTexture[projectile.type];
spriteBatch.Draw(tex, projectile.Center - Main.screenPosition, null, projectile.GetAlpha(lightColor), projectile.rotation, tex.Size() / 2f, projectile.scale, SpriteEffects.None, 0f);
CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1);
return false;
}
}
File renamed without changes.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

@@ -6,23 +6,30 @@ using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Melee.Yoyos
{
public class AzathothProjectile : ModProjectile
public class AzathothYoyo : ModProjectile
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Azathoth");
ProjectileID.Sets.YoyosLifeTimeMultiplier[projectile.type] = -1f;
ProjectileID.Sets.YoyosMaximumRange[projectile.type] = 700f;
ProjectileID.Sets.YoyosTopSpeed[projectile.type] = 20f;
ProjectileID.Sets.TrailCacheLength[projectile.type] = 8;
ProjectileID.Sets.TrailingMode[projectile.type] = 1;
}
public override void SetDefaults()
{
projectile.CloneDefaults(ProjectileID.Kraken);
projectile.aiStyle = 99;
projectile.width = 16;
projectile.scale = 1.2f;
projectile.height = 16;
projectile.scale = 1.2f;
projectile.friendly = true;
projectile.melee = true;
projectile.penetrate = -1;
projectile.extraUpdates = 1;
aiType = 554;
projectile.melee = true;
projectile.usesLocalNPCImmunity = true;
projectile.localNPCHitCooldown = 1;
}
@@ -38,8 +45,7 @@ namespace CalamityMod.Projectiles.Melee.Yoyos
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
{
Texture2D tex = Main.projectileTexture[projectile.type];
spriteBatch.Draw(tex, projectile.Center - Main.screenPosition, null, projectile.GetAlpha(lightColor), projectile.rotation, tex.Size() / 2f, projectile.scale, SpriteEffects.None, 0f);
CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1);
return false;
}
}
File renamed without changes.

Before

Width:  |  Height:  |  Size: 308 B

After

Width:  |  Height:  |  Size: 308 B

@@ -7,22 +7,29 @@ using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Melee.Yoyos
{
public class ChaotrixProjectile : ModProjectile
public class ChaotrixYoyo : ModProjectile
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Chaotrix");
ProjectileID.Sets.YoyosLifeTimeMultiplier[projectile.type] = 14f;
ProjectileID.Sets.YoyosMaximumRange[projectile.type] = 290f;
ProjectileID.Sets.YoyosTopSpeed[projectile.type] = 16f;
ProjectileID.Sets.TrailCacheLength[projectile.type] = 4;
ProjectileID.Sets.TrailingMode[projectile.type] = 0;
}
public override void SetDefaults()
{
projectile.CloneDefaults(ProjectileID.Yelets);
projectile.aiStyle = 99;
projectile.width = 16;
projectile.scale = 1.15f;
projectile.height = 16;
projectile.penetrate = 10;
projectile.scale = 1.15f;
projectile.friendly = true;
projectile.melee = true;
aiType = 549;
projectile.penetrate = -1;
projectile.extraUpdates = 1;
}
public override void AI()
@@ -43,8 +50,7 @@ namespace CalamityMod.Projectiles.Melee.Yoyos
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
{
Texture2D tex = Main.projectileTexture[projectile.type];
spriteBatch.Draw(tex, projectile.Center - Main.screenPosition, null, projectile.GetAlpha(lightColor), projectile.rotation, tex.Size() / 2f, projectile.scale, SpriteEffects.None, 0f);
CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1);
return false;
}
}
File renamed without changes.

Before

Width:  |  Height:  |  Size: 298 B

After

Width:  |  Height:  |  Size: 298 B

@@ -8,22 +8,25 @@ using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Melee.Yoyos
{
public class CnidarianProjectile : ModProjectile
public class CnidarianYoyo : ModProjectile
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Cnidarian");
ProjectileID.Sets.YoyosLifeTimeMultiplier[projectile.type] = 7f;
ProjectileID.Sets.YoyosMaximumRange[projectile.type] = 190f;
ProjectileID.Sets.YoyosTopSpeed[projectile.type] = 11f;
}
public override void SetDefaults()
{
projectile.CloneDefaults(ProjectileID.CorruptYoyo);
projectile.aiStyle = 99;
projectile.width = 16;
projectile.scale = 1.15f;
projectile.height = 16;
projectile.penetrate = 6;
projectile.scale = 1.15f;
projectile.friendly = true;
projectile.melee = true;
aiType = 542;
projectile.penetrate = -1;
}
public override void AI()
File renamed without changes.

Before

Width:  |  Height:  |  Size: 356 B

After

Width:  |  Height:  |  Size: 356 B

@@ -7,22 +7,25 @@ using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Melee.Yoyos
{
public class TheGodsGambitProjectile : ModProjectile
public class GodsGambitYoyo : ModProjectile
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("God's Gambit");
DisplayName.SetDefault("The God's Gambit");
ProjectileID.Sets.YoyosLifeTimeMultiplier[projectile.type] = -1f;
ProjectileID.Sets.YoyosMaximumRange[projectile.type] = 320f;
ProjectileID.Sets.YoyosTopSpeed[projectile.type] = 14f;
}
public override void SetDefaults()
{
projectile.CloneDefaults(ProjectileID.Kraken);
projectile.aiStyle = 99;
projectile.width = 16;
projectile.scale = 1.15f;
projectile.height = 16;
projectile.penetrate = 6;
projectile.scale = 1.15f;
projectile.friendly = true;
projectile.melee = true;
aiType = 554;
projectile.penetrate = -1;
}
public override void AI()
File renamed without changes.

Before

Width:  |  Height:  |  Size: 294 B

After

Width:  |  Height:  |  Size: 294 B

@@ -6,23 +6,30 @@ using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Melee.Yoyos
{
public class LaceratorProjectile : ModProjectile
public class LaceratorYoyo : ModProjectile
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Lacerator");
ProjectileID.Sets.YoyosLifeTimeMultiplier[projectile.type] = -1f;
ProjectileID.Sets.YoyosMaximumRange[projectile.type] = 560f;
ProjectileID.Sets.YoyosTopSpeed[projectile.type] = 20f;
ProjectileID.Sets.TrailCacheLength[projectile.type] = 8;
ProjectileID.Sets.TrailingMode[projectile.type] = 1;
}
public override void SetDefaults()
{
projectile.CloneDefaults(ProjectileID.TheEyeOfCthulhu);
projectile.aiStyle = 99;
projectile.width = 16;
projectile.scale = 1.1f;
projectile.height = 16;
projectile.scale = 1.1f;
projectile.friendly = true;
projectile.melee = true;
projectile.penetrate = -1;
projectile.extraUpdates = 1;
aiType = 555;
projectile.melee = true;
projectile.usesLocalNPCImmunity = true;
projectile.localNPCHitCooldown = 5;
}
@@ -41,8 +48,7 @@ namespace CalamityMod.Projectiles.Melee.Yoyos
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
{
Texture2D tex = Main.projectileTexture[projectile.type];
spriteBatch.Draw(tex, projectile.Center - Main.screenPosition, null, projectile.GetAlpha(lightColor), projectile.rotation, tex.Size() / 2f, projectile.scale, SpriteEffects.None, 0f);
CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1);
return false;
}
}
File renamed without changes.

Before

Width:  |  Height:  |  Size: 291 B

After

Width:  |  Height:  |  Size: 291 B

@@ -1,34 +1,39 @@
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Projectiles.Melee;
using CalamityMod.Dusts;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Melee.Yoyos
{
public class TheMicrowaveProj : ModProjectile
public class MicrowaveYoyo : ModProjectile
{
private int radius = 100;
private const float Radius = 100f;
public override void SetStaticDefaults()
{
//DisplayName.SetDefault("Bootleg Lacerator");
DisplayName.SetDefault("Microwave");
DisplayName.SetDefault("The Microwave");
ProjectileID.Sets.YoyosLifeTimeMultiplier[projectile.type] = -1f;
ProjectileID.Sets.YoyosMaximumRange[projectile.type] = 320f;
ProjectileID.Sets.YoyosTopSpeed[projectile.type] = 14f;
ProjectileID.Sets.TrailCacheLength[projectile.type] = 4;
ProjectileID.Sets.TrailingMode[projectile.type] = 0;
}
public override void SetDefaults()
{
projectile.CloneDefaults(ProjectileID.TheEyeOfCthulhu);
projectile.aiStyle = 99;
projectile.width = 16;
projectile.height = 16;
projectile.scale = 1f;
projectile.friendly = true;
projectile.melee = true;
projectile.penetrate = -1;
projectile.extraUpdates = 1;
aiType = 555;
projectile.melee = true;
projectile.usesLocalNPCImmunity = true;
projectile.localNPCHitCooldown = 10;
}
@@ -40,9 +45,9 @@ namespace CalamityMod.Projectiles.Melee.Yoyos
Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType<MicrowaveAura>(), (int)((double)projectile.damage * 0.5f), projectile.knockBack, projectile.owner, 0f, 0f);
//dust circle
int numDust = (int)(0.2f * MathHelper.TwoPi * radius);
int numDust = (int)(0.2f * MathHelper.TwoPi * Radius);
float angleIncrement = MathHelper.TwoPi / (float)numDust;
Vector2 dustOffset = new Vector2(radius, 0f);
Vector2 dustOffset = new Vector2(Radius, 0f);
dustOffset = dustOffset.RotatedByRandom(MathHelper.TwoPi);
for (int i = 0; i < numDust; i++)
{
@@ -61,10 +66,16 @@ namespace CalamityMod.Projectiles.Melee.Yoyos
}
}
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
{
CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1);
return false;
}
public override void PostDraw(SpriteBatch spriteBatch, Color lightColor)
{
Rectangle frame = new Rectangle(0, 0, 20, 16);
spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Projectiles/Melee/Yoyos/TheMicrowaveProjGlow"), projectile.Center - Main.screenPosition, frame, Color.White, projectile.rotation, projectile.Size / 2, 1f, SpriteEffects.None, 0f);
spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Projectiles/Melee/Yoyos/MicrowaveYoyoGlow"), projectile.Center - Main.screenPosition, frame, Color.White, projectile.rotation, projectile.Size / 2, 1f, SpriteEffects.None, 0f);
}
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
File renamed without changes.

Before

Width:  |  Height:  |  Size: 386 B

After

Width:  |  Height:  |  Size: 386 B

File renamed without changes.

Before

Width:  |  Height:  |  Size: 167 B

After

Width:  |  Height:  |  Size: 167 B

@@ -7,22 +7,28 @@ using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Melee.Yoyos
{
public class TheEyeofCalamitasProjectile : ModProjectile
public class OblivionYoyo : ModProjectile
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Oblivion");
ProjectileID.Sets.YoyosLifeTimeMultiplier[projectile.type] = -1f;
ProjectileID.Sets.YoyosMaximumRange[projectile.type] = 360f;
ProjectileID.Sets.YoyosTopSpeed[projectile.type] = 16.5f;
ProjectileID.Sets.TrailCacheLength[projectile.type] = 4;
ProjectileID.Sets.TrailingMode[projectile.type] = 0;
}
public override void SetDefaults()
{
projectile.CloneDefaults(ProjectileID.TheEyeOfCthulhu);
projectile.aiStyle = 99;
projectile.width = 16;
projectile.scale = 1.1f;
projectile.height = 16;
projectile.penetrate = -1;
projectile.scale = 1.1f;
projectile.friendly = true;
projectile.melee = true;
aiType = 555;
projectile.penetrate = -1;
}
public override void AI()
@@ -81,8 +87,7 @@ namespace CalamityMod.Projectiles.Melee.Yoyos
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
{
Texture2D tex = Main.projectileTexture[projectile.type];
spriteBatch.Draw(tex, projectile.Center - Main.screenPosition, null, projectile.GetAlpha(lightColor), projectile.rotation, tex.Size() / 2f, projectile.scale, SpriteEffects.None, 0f);
CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1);
return false;
}
}
File renamed without changes.

Before

Width:  |  Height:  |  Size: 264 B

After

Width:  |  Height:  |  Size: 264 B

+5 -3
View File
@@ -1,5 +1,4 @@
using CalamityMod.Items.Weapons.Melee;
using CalamityMod.Projectiles.Typeless;
using CalamityMod.Projectiles.Typeless;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
@@ -54,7 +53,7 @@ namespace CalamityMod.Projectiles.Melee.Yoyos
public override void AI()
{
// Produces golden dust constantly while in flight. This lights the yoyo.
// Produces golden dust constantly while in flight. This helps light the yoyo.
if (Main.rand.NextBool())
{
int dustType = Main.rand.NextBool(3) ? 244 : 246;
@@ -65,6 +64,9 @@ namespace CalamityMod.Projectiles.Melee.Yoyos
Main.dust[idx].scale = scale;
}
// The yoyo makes its own faint yellow light (unnoticeable once the lightning aura gets going)
Lighting.AddLight(projectile.Center, 0.6f, 0.42f, 0.1f);
// The aura discharges over time based on its current charge.
float discharge = MinDischargeRate + 0.003f * projectile.localAI[1];
if (discharge > MaxDischargeRate)
@@ -8,22 +8,25 @@ using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Melee.Yoyos
{
public class ThePlaguebringerYoyo : ModProjectile
public class PandemicYoyo : ModProjectile
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Pandemic");
ProjectileID.Sets.YoyosLifeTimeMultiplier[projectile.type] = -1f;
ProjectileID.Sets.YoyosMaximumRange[projectile.type] = 340f;
ProjectileID.Sets.YoyosTopSpeed[projectile.type] = 16.5f;
}
public override void SetDefaults()
{
projectile.CloneDefaults(ProjectileID.TheEyeOfCthulhu);
projectile.aiStyle = 99;
projectile.width = 16;
projectile.scale = 1f;
projectile.height = 16;
projectile.penetrate = -1;
projectile.scale = 1f;
projectile.friendly = true;
projectile.melee = true;
aiType = 555;
projectile.penetrate = -1;
}
public override void AI()
File renamed without changes.

Before

Width:  |  Height:  |  Size: 287 B

After

Width:  |  Height:  |  Size: 287 B

@@ -6,22 +6,25 @@ using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Melee.Yoyos
{
public class QuagmireProjectile : ModProjectile
public class QuagmireYoyo : ModProjectile
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Quagmire");
ProjectileID.Sets.YoyosLifeTimeMultiplier[projectile.type] = 12f;
ProjectileID.Sets.YoyosMaximumRange[projectile.type] = 275f;
ProjectileID.Sets.YoyosTopSpeed[projectile.type] = 15f;
}
public override void SetDefaults()
{
projectile.CloneDefaults(ProjectileID.HelFire);
projectile.aiStyle = 99;
projectile.width = 16;
projectile.scale = 1.25f;
projectile.height = 16;
projectile.penetrate = 8;
projectile.scale = 1.25f;
projectile.friendly = true;
projectile.melee = true;
aiType = 553;
projectile.penetrate = -1;
}
public override void AI()
File renamed without changes.

Before

Width:  |  Height:  |  Size: 328 B

After

Width:  |  Height:  |  Size: 328 B

@@ -4,25 +4,26 @@ using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Melee.Yoyos
{
public class WhirlpoolProjectile : ModProjectile
public class RiptideYoyo : ModProjectile
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Riptide");
ProjectileID.Sets.YoyosLifeTimeMultiplier[projectile.type] = 7.5f;
ProjectileID.Sets.YoyosMaximumRange[projectile.type] = 180f;
ProjectileID.Sets.YoyosTopSpeed[projectile.type] = 12.5f;
}
public override void SetDefaults()
{
projectile.aiStyle = 99;
projectile.width = 16;
projectile.height = 16;
projectile.scale = 0.75f;
projectile.scale = 1f;
projectile.friendly = true;
projectile.melee = true;
projectile.alpha = 150;
projectile.penetrate = -1;
projectile.timeLeft = 99;
projectile.melee = true;
aiType = ProjectileID.Amarok;
projectile.CloneDefaults(ProjectileID.CorruptYoyo);
}
public override void AI()
File renamed without changes.

Before

Width:  |  Height:  |  Size: 292 B

After

Width:  |  Height:  |  Size: 292 B

@@ -7,22 +7,25 @@ using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Melee.Yoyos
{
public class ShimmersparkProjectile : ModProjectile
public class ShimmersparkYoyo : ModProjectile
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Shimmerspark");
ProjectileID.Sets.YoyosLifeTimeMultiplier[projectile.type] = 16f;
ProjectileID.Sets.YoyosMaximumRange[projectile.type] = 275f;
ProjectileID.Sets.YoyosTopSpeed[projectile.type] = 17f;
}
public override void SetDefaults()
{
projectile.CloneDefaults(ProjectileID.Chik);
projectile.aiStyle = 99;
projectile.width = 16;
projectile.scale = 0.9f;
projectile.height = 16;
projectile.penetrate = 8;
projectile.scale = 1f;
projectile.friendly = true;
projectile.melee = true;
aiType = 546;
projectile.penetrate = -1;
}
public override void AI()
File renamed without changes.

Before

Width:  |  Height:  |  Size: 557 B

After

Width:  |  Height:  |  Size: 557 B

+13 -6
View File
@@ -5,6 +5,7 @@ using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Melee.Yoyos
{
public class SolarFlareYoyo : ModProjectile
@@ -12,18 +13,25 @@ namespace CalamityMod.Projectiles.Melee.Yoyos
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Solar Flare");
ProjectileID.Sets.YoyosLifeTimeMultiplier[projectile.type] = -1f;
ProjectileID.Sets.YoyosMaximumRange[projectile.type] = 560f;
ProjectileID.Sets.YoyosTopSpeed[projectile.type] = 20f;
ProjectileID.Sets.TrailCacheLength[projectile.type] = 8;
ProjectileID.Sets.TrailingMode[projectile.type] = 1;
}
public override void SetDefaults()
{
projectile.CloneDefaults(ProjectileID.TheEyeOfCthulhu);
projectile.aiStyle = 99;
projectile.width = 16;
projectile.scale = 1.15f;
projectile.height = 16;
projectile.scale = 1.15f;
projectile.friendly = true;
projectile.melee = true;
projectile.penetrate = -1;
projectile.extraUpdates = 1;
aiType = 555;
projectile.melee = true;
projectile.usesLocalNPCImmunity = true;
projectile.localNPCHitCooldown = 5;
}
@@ -46,8 +54,7 @@ namespace CalamityMod.Projectiles.Melee.Yoyos
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
{
Texture2D tex = Main.projectileTexture[projectile.type];
spriteBatch.Draw(tex, projectile.Center - Main.screenPosition, null, projectile.GetAlpha(lightColor), projectile.rotation, tex.Size() / 2f, projectile.scale, SpriteEffects.None, 0f);
CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1);
return false;
}
}
+71 -47
View File
@@ -1,7 +1,7 @@
using CalamityMod.Projectiles.Ranged;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System;
using System.Collections.Generic;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -12,78 +12,102 @@ namespace CalamityMod.Projectiles.Melee.Yoyos
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Obliterator");
DisplayName.SetDefault("The Obliterator");
ProjectileID.Sets.YoyosLifeTimeMultiplier[projectile.type] = -1f;
ProjectileID.Sets.YoyosMaximumRange[projectile.type] = 580f;
ProjectileID.Sets.YoyosTopSpeed[projectile.type] = 22f;
ProjectileID.Sets.TrailCacheLength[projectile.type] = 8;
ProjectileID.Sets.TrailingMode[projectile.type] = 1;
}
public override void SetDefaults()
{
projectile.CloneDefaults(ProjectileID.TheEyeOfCthulhu);
projectile.aiStyle = 99;
projectile.width = 16;
projectile.height = 16;
projectile.scale = 1.6f;
projectile.friendly = true;
projectile.melee = true;
projectile.penetrate = -1;
projectile.extraUpdates = 1;
aiType = 555;
projectile.melee = true;
projectile.usesLocalNPCImmunity = true;
projectile.localNPCHitCooldown = 3;
projectile.localNPCHitCooldown = 5;
}
// localAI[1] is the shot counter. Every 5 frames, The Obliterator tries to fire a laser at a nearby target.
// It has 4 "laser ports" which whirl around in circles with the yoyo. It uses each of these in order.
// localAI[1] counts up to 19 (4 x 5 - 1), then resets back to 0 for a 20-frame cycle.
public override void AI()
{
int[] array = new int[20];
int num428 = 0;
float num429 = 300f;
bool flag14 = false;
for (int num430 = 0; num430 < 200; num430++)
Lighting.AddLight(projectile.Center, 0.8f, 0.3f, 1f);
projectile.localAI[1]++;
if (projectile.localAI[1] >= 20f)
projectile.localAI[1] = 0f;
// Attempt to fire a laser every 5 frames
if(projectile.localAI[1] % 5f == 0f)
{
if (Main.npc[num430].CanBeChasedBy(projectile, false))
List<int> targets = new List<int>();
float laserRange = 300f;
for (int i = 0; i < Main.npc.Length; ++i)
{
float num431 = Main.npc[num430].position.X + Main.npc[num430].width / 2;
float num432 = Main.npc[num430].position.Y + Main.npc[num430].height / 2;
float num433 = Math.Abs(projectile.position.X + projectile.width / 2 - num431) + Math.Abs(projectile.position.Y + projectile.height / 2 - num432);
if (num433 < num429 && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num430].Center, 1, 1))
ref NPC n = ref Main.npc[i];
if (n is null || !n.active)
continue;
if (n.CanBeChasedBy(projectile, false) && (n.Center - projectile.Center).Length() <= laserRange && Collision.CanHit(projectile.Center, 1, 1, n.Center, 1, 1))
{
if (num428 < 20)
{
array[num428] = num430;
num428++;
}
flag14 = true;
targets.Add(i);
// Bosses are added 5 times instead of 1 so that they are preferentially but not exclusively targeted.
if (n.boss)
for (int j = 0; j < 4; ++j)
targets.Add(i);
}
}
}
if (flag14)
{
int num434 = Main.rand.Next(num428);
num434 = array[num434];
float num435 = Main.npc[num434].position.X + Main.npc[num434].width / 2;
float num436 = Main.npc[num434].position.Y + Main.npc[num434].height / 2;
projectile.localAI[0] += 1f;
if (projectile.localAI[0] > 16f)
if (targets.Count == 0)
return;
// Pick which of the four corners the laser is spawning in
Vector2 laserSpawnPosition = projectile.Center;
Vector2 offset;
if (projectile.localAI[1] < 5f)
offset = new Vector2(7, 7);
else if (projectile.localAI[1] < 10f)
offset = new Vector2(-7, 7);
else if (projectile.localAI[1] < 15f)
offset = new Vector2(-7, -7);
else
offset = new Vector2(7, -7);
laserSpawnPosition += offset.RotatedBy(projectile.rotation);
ref NPC target = ref Main.npc[targets[Main.rand.Next(targets.Count)]];
const float laserSpeed = 6f;
int laserDamage = (int)(projectile.damage * 0.5f);
const float laserKB = 3f;
Vector2 velocity = target.Center - projectile.Center;
velocity = velocity.SafeNormalize(Vector2.Zero) * laserSpeed;
if (projectile.owner == Main.myPlayer)
{
projectile.localAI[0] = 0f;
float num437 = 6f;
Vector2 value10 = new Vector2(projectile.position.X + projectile.width * 0.5f, projectile.position.Y + projectile.height * 0.5f);
value10 += projectile.velocity * 4f;
float num438 = num435 - value10.X;
float num439 = num436 - value10.Y;
float num440 = (float)Math.Sqrt(num438 * num438 + num439 * num439);
num440 = num437 / num440;
num438 *= num440;
num439 *= num440;
if (projectile.owner == Main.myPlayer)
{
int proj = Projectile.NewProjectile(value10.X, value10.Y, num438, num439, ModContent.ProjectileType<NebulaShot>(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f);
Main.projectile[proj].Calamity().forceMelee = true;
}
// ai[0] = 1f for melee
int proj = Projectile.NewProjectile(laserSpawnPosition, velocity, ModContent.ProjectileType<NebulaShot>(), laserDamage, laserKB, projectile.owner, 1f, 0f);
Main.projectile[proj].Calamity().forceMelee = true;
}
}
}
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
{
CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1);
return false;
}
public override void PostDraw(SpriteBatch spriteBatch, Color lightColor)
{
Vector2 origin = new Vector2(10f, 10f);
spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Projectiles/Melee/Yoyos/TheObliteratorGlow"), projectile.Center - Main.screenPosition, null, Color.White, projectile.rotation, origin, 1f, SpriteEffects.None, 0f);
spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Projectiles/Melee/Yoyos/TheObliteratorGlow"), projectile.Center - Main.screenPosition, null, Color.White, projectile.rotation, origin, 2f, SpriteEffects.None, 0f);
}
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
@@ -7,22 +7,31 @@ using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Melee.Yoyos
{
public class VerdantProjectile : ModProjectile
public class VerdantYoyo : ModProjectile
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Verdant");
ProjectileID.Sets.YoyosLifeTimeMultiplier[projectile.type] = -1f;
ProjectileID.Sets.YoyosMaximumRange[projectile.type] = 400;
ProjectileID.Sets.YoyosTopSpeed[projectile.type] = 17f;
ProjectileID.Sets.TrailCacheLength[projectile.type] = 8;
ProjectileID.Sets.TrailingMode[projectile.type] = 1;
}
public override void SetDefaults()
{
projectile.CloneDefaults(ProjectileID.Kraken);
projectile.aiStyle = 99;
projectile.width = 16;
projectile.scale = 1.1f;
projectile.height = 16;
projectile.penetrate = -1;
projectile.scale = 1.1f;
projectile.friendly = true;
projectile.melee = true;
aiType = 554;
projectile.penetrate = -1;
projectile.usesLocalNPCImmunity = true;
projectile.localNPCHitCooldown = 9;
}
public override void AI()
@@ -86,8 +95,7 @@ namespace CalamityMod.Projectiles.Melee.Yoyos
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
{
Texture2D tex = Main.projectileTexture[projectile.type];
spriteBatch.Draw(tex, projectile.Center - Main.screenPosition, null, projectile.GetAlpha(lightColor), projectile.rotation, tex.Size() / 2f, projectile.scale, SpriteEffects.None, 0f);
CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1);
return false;
}
}
File renamed without changes.

Before

Width:  |  Height:  |  Size: 259 B

After

Width:  |  Height:  |  Size: 259 B

+8 -5
View File
@@ -11,18 +11,21 @@ namespace CalamityMod.Projectiles.Melee.Yoyos
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Yinyo");
DisplayName.SetDefault("Yin-Yo");
ProjectileID.Sets.YoyosLifeTimeMultiplier[projectile.type] = 14f;
ProjectileID.Sets.YoyosMaximumRange[projectile.type] = 275f;
ProjectileID.Sets.YoyosTopSpeed[projectile.type] = 17f;
}
public override void SetDefaults()
{
projectile.CloneDefaults(ProjectileID.Chik);
projectile.aiStyle = 99;
projectile.width = 16;
projectile.scale = 0.9f;
projectile.height = 16;
projectile.penetrate = 5;
projectile.scale = 1f;
projectile.friendly = true;
projectile.melee = true;
aiType = 546;
projectile.penetrate = -1;
}
public override void AI()
+121
View File
@@ -0,0 +1,121 @@
using CalamityMod.Items.Weapons.Rogue;
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Buffs.StatDebuffs;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System;
using System.Collections.Generic;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Rogue
{
public class ShockGrenadeBolt : ModProjectile
{
public static int frameWidth = 12;
public static int frameHeight = 26;
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Bolt");
Main.projFrames[projectile.type] = 4;
}
public override void SetDefaults()
{
projectile.width = 10;
projectile.height = 10;
projectile.friendly = true;
projectile.tileCollide = false;
projectile.penetrate = 3;
projectile.timeLeft = 120;
projectile.Calamity().rogue = true;
}
public override void AI()
{
projectile.frameCounter++;
if (projectile.frameCounter > 6)
{
projectile.frame++;
projectile.frameCounter = 0;
}
if (projectile.frame >= Main.projFrames[projectile.type])
{
projectile.frame = 0;
}
projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f;
if (projectile.timeLeft < 55)
{
projectile.tileCollide = true;
}
if (projectile.ai[1] == 1f)
{
float minDist = 999f;
int index = 0;
for (int i = 0; i < Main.npc.Length; i++)
{
NPC npc = Main.npc[i];
if (!npc.friendly && !npc.townNPC && npc.active && !npc.dontTakeDamage && npc.chaseable)
{
float dist = (projectile.Center - npc.Center).Length();
if (dist < minDist)
{
minDist = dist;
index = i;
}
}
}
Vector2 velocityNew;
if (minDist < 999f)
{
velocityNew = Main.npc[index].Center - projectile.Center;
velocityNew.Normalize();
velocityNew *= 2f;
projectile.velocity += velocityNew;
if (projectile.velocity.Length() > 10f)
{
projectile.velocity.Normalize();
projectile.velocity *= 10f;
}
}
}
}
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
{
target.AddBuff(BuffID.Electrified, 180);
}
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
{
Texture2D sprite;
if (projectile.ai[0] == 0f)
sprite = ModContent.GetTexture("CalamityMod/Projectiles/Rogue/ShockGrenadeBolt");
else
sprite = ModContent.GetTexture("CalamityMod/Projectiles/Rogue/ShockGrenadeBolt2");
Color drawColour = Color.White;
Vector2 origin = new Vector2(frameWidth / 2, frameHeight / 2);
spriteBatch.Draw(sprite, projectile.Center - Main.screenPosition, new Rectangle(0, frameHeight * projectile.frame, frameWidth, frameHeight), drawColour, projectile.rotation, origin, 1f, SpriteEffects.None, 0f);
return false;
}
public override void Kill(int timeLeft)
{
Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 93, 0.25f, 0f);
for (int i = 0; i < 5; i++)
{
int dustType = 132;
int dust = Dust.NewDust(projectile.Center, 1, 1, dustType, projectile.velocity.X, projectile.velocity.Y, 0, default, 0.5f);
Main.dust[dust].noGravity = true;
}
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 352 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 269 B

@@ -0,0 +1,77 @@
using CalamityMod.Buffs.DamageOverTime;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Rogue
{
public class ShockGrenadeExplosion : ModProjectile
{
private const float radius = 100f;
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Shock Grenade Explosion");
}
public override void SetDefaults()
{
projectile.width = 320;
projectile.height = 320;
projectile.friendly = true;
projectile.penetrate = -1;
projectile.tileCollide = false;
projectile.ignoreWater = true;
projectile.timeLeft = 10;
projectile.usesLocalNPCImmunity = true;
projectile.localNPCHitCooldown = -1;
projectile.Calamity().rogue = true;
}
public override void AI()
{
if (projectile.timeLeft >= 8)
{
for (int i = 0; i < 50; i++)
{
int dustType = 132;
if (Main.rand.NextBool())
{
dustType = 264;
}
Vector2 dustVelocity = new Vector2(Main.rand.NextFloat(-1, 1), Main.rand.NextFloat(-1, 1));
dustVelocity.Normalize();
dustVelocity *= 8;
int dust = Dust.NewDust(projectile.Center, 1, 1, dustType, dustVelocity.X, dustVelocity.Y, 0, default, 0.75f);
Main.dust[dust].noGravity = true;
}
}
}
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
{
target.AddBuff(BuffID.Electrified, 300);
}
public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox)
{
float dist1 = Vector2.Distance(projectile.Center, targetHitbox.TopLeft());
float dist2 = Vector2.Distance(projectile.Center, targetHitbox.TopRight());
float dist3 = Vector2.Distance(projectile.Center, targetHitbox.BottomLeft());
float dist4 = Vector2.Distance(projectile.Center, targetHitbox.BottomRight());
float minDist = dist1;
if (dist2 < minDist)
minDist = dist2;
if (dist3 < minDist)
minDist = dist3;
if (dist4 < minDist)
minDist = dist4;
return minDist <= radius;
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

+133
View File
@@ -0,0 +1,133 @@
using CalamityMod.Buffs.StatDebuffs;
using CalamityMod.Projectiles.Typeless;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Rogue
{
public class ShockGrenadeProjectile : ModProjectile
{
public static int spriteWidth = 14;
public static int spriteHeight = 30;
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Shock Grenade");
}
public override void SetDefaults()
{
projectile.width = 10;
projectile.height = 10;
projectile.friendly = true;
projectile.penetrate = 1;
projectile.timeLeft = 180;
projectile.Calamity().rogue = true;
}
public override void AI()
{
projectile.velocity.Y += 0.1f;
if (projectile.velocity.Y >= 16f)
{
projectile.velocity.Y = 16f;
}
projectile.rotation += projectile.direction * 0.2f;
}
public override bool OnTileCollide(Vector2 oldVelocity)
{
Collision.HitTiles(projectile.position + projectile.velocity, projectile.velocity, projectile.width, projectile.height);
projectile.localAI[0] = 0;
projectile.localAI[1] = 0;
if (projectile.velocity.X != oldVelocity.X)
{
if (oldVelocity.X < 0)
{
projectile.localAI[0] = 1;
}
if (oldVelocity.X > 0)
{
projectile.localAI[0] = -1;
}
}
if (projectile.velocity.Y != oldVelocity.Y)
{
if (oldVelocity.Y < 0)
{
projectile.localAI[1] = 1;
}
if (oldVelocity.Y > 0)
{
projectile.localAI[1] = -1;
}
}
projectile.Kill();
return false;
}
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
{
Texture2D tex = Main.projectileTexture[projectile.type];
spriteBatch.Draw(tex, projectile.Center - Main.screenPosition, null, projectile.GetAlpha(lightColor), projectile.rotation, tex.Size() / 2f, projectile.scale, SpriteEffects.None, 0f);
return false;
}
public override void PostDraw(SpriteBatch spriteBatch, Color lightColor)
{
Vector2 origin = new Vector2(spriteWidth / 2, spriteHeight / 2);
spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Projectiles/Rogue/ShockGrenadeProjectileGlow"), projectile.Center - Main.screenPosition, null, Color.White, projectile.rotation, origin, 1f, SpriteEffects.None, 0f);
}
public override void Kill(int timeLeft)
{
Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 94, 0.75f, 0f);
int boltCount = Main.rand.Next(5, 11);
for (int i = 0; i < boltCount; i++)
{
int boltScatter = 1;
Vector2 boltVelocity = new Vector2(Main.rand.NextFloat(-boltScatter, boltScatter), Main.rand.NextFloat(-boltScatter * 2, boltScatter * 2));
if (projectile.localAI[0] != 0)
{
boltVelocity.X *= -1;
}
if (projectile.localAI[1] != 0)
{
boltVelocity.Y *= -1;
}
boltVelocity.X += projectile.localAI[0];
boltVelocity.Y += projectile.localAI[1] * 2;
boltVelocity.Normalize();
boltVelocity *= 10;
int boltType = Main.rand.Next(0, 2);
int boltDamage = projectile.damage / 2;
int boltAI = 0;
if (projectile.Calamity().stealthStrike)
{
boltAI = 1;
}
Projectile.NewProjectile(projectile.Center, boltVelocity, ModContent.ProjectileType<ShockGrenadeBolt>(), boltDamage, 0, projectile.owner, boltType, boltAI);
}
if (projectile.Calamity().stealthStrike)
{
int auraDamage = projectile.damage / 4;
Projectile.NewProjectile(projectile.Center, Vector2.Zero, ModContent.ProjectileType<ShockTeslaAura>(), auraDamage, 1, projectile.owner, 0, 0);
Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 93, 0.5f, 0f);
}
Projectile.NewProjectile(projectile.Center, Vector2.Zero, ModContent.ProjectileType<ShockGrenadeExplosion>(), projectile.damage, 3, projectile.owner, 0, 0);
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 367 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 172 B

+137
View File
@@ -0,0 +1,137 @@

using CalamityMod.NPCs;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Rogue
{
public class ShockTeslaAura : ModProjectile
{
private const float radius = 98f;
private const int lifetime = 240;
private const int framesX = 3;
private const int framesY = 6;
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Electrifying Aura");
}
public override void SetDefaults()
{
projectile.width = 218;
projectile.height = 218;
projectile.friendly = true;
projectile.ignoreWater = true;
projectile.tileCollide = false;
projectile.penetrate = -1;
projectile.timeLeft = lifetime;
projectile.usesLocalNPCImmunity = true;
projectile.localNPCHitCooldown = 20;
projectile.Calamity().rogue = true;
}
public override void AI()
{
projectile.frameCounter++;
if (projectile.frameCounter > 3)
{
projectile.localAI[0]++;
projectile.frameCounter = 0;
}
if (projectile.localAI[0] >= framesY)
{
projectile.localAI[0] = 0;
projectile.localAI[1]++;
}
if (projectile.localAI[1] >= framesX)
{
projectile.localAI[1] = 0;
}
Player player = Main.player[Main.myPlayer];
Vector2 posDiff = player.Center - projectile.Center;
if (posDiff.Length() <= radius)
{
player.statDefense += 6;
player.lifeRegen += 2;
}
}
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
{
Texture2D sprite = Main.projectileTexture[projectile.type];
Color drawColour = Color.White;
Rectangle sourceRect = new Rectangle(projectile.width * (int)projectile.localAI[1], projectile.height * (int)projectile.localAI[0], projectile.width, projectile.height);
Vector2 origin = new Vector2(projectile.width / 2, projectile.height / 2);
float opacity = 1f;
int sparkCount = 0;
int fadeTime = 20;
if (projectile.timeLeft < fadeTime)
{
opacity = projectile.timeLeft * (1f / fadeTime);
sparkCount = fadeTime - projectile.timeLeft;
}
for (int i = 0; i < sparkCount * 2; i++)
{
int dustType = 132;
if (Main.rand.NextBool())
{
dustType = 264;
}
float rangeDiff = 2f;
Vector2 dustPos = new Vector2(Main.rand.NextFloat(-1, 1), Main.rand.NextFloat(-1, 1));
dustPos.Normalize();
dustPos *= radius + Main.rand.NextFloat(-rangeDiff, rangeDiff);
int dust = Dust.NewDust(projectile.Center + dustPos, 1, 1, dustType, 0, 0, 0, default, 0.75f);
Main.dust[dust].noGravity = true;
}
spriteBatch.Draw(sprite, projectile.Center - Main.screenPosition, sourceRect, drawColour * opacity, projectile.rotation, origin, 1f, SpriteEffects.None, 0f);
return false;
}
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
{
if (CalamityGlobalNPC.ShouldAffectNPC(target))
{
float knockbackMultiplier = knockback - target.knockBackResist;
if (knockbackMultiplier < 0)
{
knockbackMultiplier = 0;
}
Vector2 trueKnockback = target.Center - projectile.Center;
trueKnockback.Normalize();
target.velocity = trueKnockback * knockbackMultiplier;
}
target.AddBuff(BuffID.Electrified, 300);
}
public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox)
{
float dist1 = Vector2.Distance(projectile.Center, targetHitbox.TopLeft());
float dist2 = Vector2.Distance(projectile.Center, targetHitbox.TopRight());
float dist3 = Vector2.Distance(projectile.Center, targetHitbox.BottomLeft());
float dist4 = Vector2.Distance(projectile.Center, targetHitbox.BottomRight());
float minDist = dist1;
if (dist2 < minDist)
minDist = dist2;
if (dist3 < minDist)
minDist = dist3;
if (dist4 < minDist)
minDist = dist4;
return minDist <= radius;
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB