Merge branch 'master' of https://github.com/UncleDanny/CalamityMod
This commit is contained in:
commit
8e68ab2ea4
10 files changed
+96
-56
No files matched your search
@@ -5206,19 +5206,17 @@ namespace CalamityMod.CalPlayer
|
||||
{
|
||||
if (flag)
|
||||
{
|
||||
nPC.StrikeNPC(num3, 0f, 0, false, false, false);
|
||||
if (Main.netMode != NetmodeID.SinglePlayer)
|
||||
if (player.whoAmI == Main.myPlayer)
|
||||
{
|
||||
NetMessage.SendData(28, -1, -1, null, l, (float)num3, 0f, 0f, 0, 0, 0);
|
||||
Projectile p = Projectile.NewProjectileDirect(nPC.Center, Vector2.Zero, ModContent.ProjectileType<DirectStrike>(), num3, 0f, player.whoAmI, l);
|
||||
p.minion = true;
|
||||
p.Calamity().forceMinion = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
lifeCounter++;
|
||||
if (lifeCounter >= 180)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
if (player.inventory[player.selectedItem].type == ModContent.ItemType<NavyFishingRod>() && player.ownedProjectileCounts[ModContent.ProjectileType<NavyBobber>()] != 0)
|
||||
@@ -5239,12 +5237,11 @@ namespace CalamityMod.CalPlayer
|
||||
{
|
||||
if (flag)
|
||||
{
|
||||
nPC.StrikeNPC(num3, 0f, 0, false, false, false);
|
||||
if (Main.netMode != NetmodeID.SinglePlayer)
|
||||
{
|
||||
NetMessage.SendData(28, -1, -1, null, l, (float)num3, 0f, 0f, 0, 0, 0);
|
||||
}
|
||||
Vector2 value15 = new Vector2((float)Main.rand.Next(-50, 51), (float)Main.rand.Next(-50, 51));
|
||||
if (player.whoAmI == Main.myPlayer)
|
||||
{
|
||||
Projectile p = Projectile.NewProjectileDirect(nPC.Center, Vector2.Zero, ModContent.ProjectileType<DirectStrike>(), num3, 0f, player.whoAmI, l);
|
||||
}
|
||||
Vector2 value15 = new Vector2((float)Main.rand.Next(-50, 51), (float)Main.rand.Next(-50, 51));
|
||||
while (value15.X == 0f && value15.Y == 0f)
|
||||
{
|
||||
value15 = new Vector2((float)Main.rand.Next(-50, 51), (float)Main.rand.Next(-50, 51));
|
||||
@@ -5260,9 +5257,6 @@ namespace CalamityMod.CalPlayer
|
||||
}
|
||||
}
|
||||
auraCounter++;
|
||||
if (auraCounter >= 180)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
if (brimstoneElementalLore && player.inferno)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using CalamityMod.CalPlayer;
|
||||
using CalamityMod.Projectiles.Typeless;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
@@ -53,10 +54,9 @@ namespace CalamityMod.Items.Accessories
|
||||
}
|
||||
if (flag)
|
||||
{
|
||||
nPC.StrikeNPC(num3, 0f, 0, false, false, false);
|
||||
if (Main.netMode != NetmodeID.SinglePlayer)
|
||||
if (player.whoAmI == Main.myPlayer)
|
||||
{
|
||||
NetMessage.SendData(28, -1, -1, null, l, (float)num3, 0f, 0f, 0, 0, 0);
|
||||
Projectile p = Projectile.NewProjectileDirect(nPC.Center, Vector2.Zero, ModContent.ProjectileType<DirectStrike>(), num3, 0f, player.whoAmI, l);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -64,9 +64,6 @@ namespace CalamityMod.Items.Accessories
|
||||
}
|
||||
}
|
||||
bloomCounter++;
|
||||
if (bloomCounter >= 180)
|
||||
{
|
||||
}
|
||||
if (player.whoAmI == Main.myPlayer && player.velocity.Y == 0f && player.grappling[0] == -1)
|
||||
{
|
||||
int num4 = (int)player.Center.X / 16;
|
||||
|
||||
@@ -73,10 +73,9 @@ namespace CalamityMod.Items.Accessories
|
||||
}
|
||||
if (flag)
|
||||
{
|
||||
nPC.StrikeNPC(num3, 0f, 0, false, false, false);
|
||||
if (Main.netMode != NetmodeID.SinglePlayer)
|
||||
if (player.whoAmI == Main.myPlayer)
|
||||
{
|
||||
NetMessage.SendData(28, -1, -1, null, l, (float)num3, 0f, 0f, 0, 0, 0);
|
||||
Projectile p = Projectile.NewProjectileDirect(nPC.Center, Vector2.Zero, ModContent.ProjectileType<DirectStrike>(), num3, 0f, player.whoAmI, l);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -84,9 +83,6 @@ namespace CalamityMod.Items.Accessories
|
||||
}
|
||||
}
|
||||
seaCounter++;
|
||||
if (seaCounter >= 180)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
using CalamityMod.CalPlayer;
|
||||
using CalamityMod.Projectiles.Typeless;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
@@ -73,10 +74,11 @@ namespace CalamityMod.Items.Accessories
|
||||
}
|
||||
if (flag)
|
||||
{
|
||||
nPC.StrikeNPC(num3, 0f, 0, false, false, false);
|
||||
if (Main.netMode != NetmodeID.SinglePlayer)
|
||||
if (player.whoAmI == Main.myPlayer)
|
||||
{
|
||||
NetMessage.SendData(28, -1, -1, null, l, (float)num3, 0f, 0f, 0, 0, 0);
|
||||
Projectile p = Projectile.NewProjectileDirect(nPC.Center, Vector2.Zero, ModContent.ProjectileType<DirectStrike>(), num3, 0f, player.whoAmI, l);
|
||||
p.minion = true;
|
||||
p.Calamity().forceMinion = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -141,10 +141,11 @@ namespace CalamityMod.Items.Accessories
|
||||
}
|
||||
if (flag)
|
||||
{
|
||||
nPC.StrikeNPC(num3, 0f, 0, false, false, false);
|
||||
if (Main.netMode != NetmodeID.SinglePlayer)
|
||||
if (player.whoAmI == Main.myPlayer)
|
||||
{
|
||||
NetMessage.SendData(28, -1, -1, null, l, (float)num3, 0f, 0f, 0, 0, 0);
|
||||
Projectile p = Projectile.NewProjectileDirect(nPC.Center, Vector2.Zero, ModContent.ProjectileType<DirectStrike>(), num3, 0f, player.whoAmI, l);
|
||||
p.minion = true;
|
||||
p.Calamity().forceMinion = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
using CalamityMod.Projectiles.Typeless;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
@@ -48,10 +49,11 @@ namespace CalamityMod.Items.Accessories
|
||||
}
|
||||
if (flag)
|
||||
{
|
||||
nPC.StrikeNPC(num3, 0f, 0, false, false, false);
|
||||
if (Main.netMode != NetmodeID.SinglePlayer)
|
||||
if (player.whoAmI == Main.myPlayer)
|
||||
{
|
||||
NetMessage.SendData(28, -1, -1, null, l, (float)num3, 0f, 0f, 0, 0, 0);
|
||||
Projectile p = Projectile.NewProjectileDirect(nPC.Center, Vector2.Zero, ModContent.ProjectileType<DirectStrike>(), num3, 0f, player.whoAmI, l);
|
||||
p.minion = true;
|
||||
p.Calamity().forceMinion = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Items.Placeables.Ores;
|
||||
using CalamityMod.Projectiles.Melee.Yoyos;
|
||||
using CalamityMod.Tiles.Furniture.CraftingStations;
|
||||
using Microsoft.Xna.Framework;
|
||||
@@ -11,36 +10,38 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
{
|
||||
public class Oracle : ModItem
|
||||
{
|
||||
public static int BaseDamage = 480;
|
||||
|
||||
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'");
|
||||
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);
|
||||
ItemID.Sets.Yoyo[item.type] = true;
|
||||
|
||||
item.width = 54;
|
||||
item.height = 42;
|
||||
item.melee = true;
|
||||
item.damage = BaseDamage;
|
||||
item.damage = 420;
|
||||
item.knockBack = 4f;
|
||||
item.useTime = 20;
|
||||
item.useAnimation = 20;
|
||||
item.autoReuse = true;
|
||||
|
||||
item.useStyle = 5;
|
||||
item.UseSound = SoundID.Item1;
|
||||
item.channel = true;
|
||||
item.noUseGraphic = true;
|
||||
item.noMelee = true;
|
||||
|
||||
item.shoot = ModContent.ProjectileType<OracleYoyo>();
|
||||
item.shootSpeed = 16f;
|
||||
|
||||
item.rare = 10;
|
||||
item.Calamity().postMoonLordRarity = 21;
|
||||
item.value = Item.buyPrice(2, 50, 0, 0);
|
||||
|
||||
item.shoot = ModContent.ProjectileType<OracleYoyo>();
|
||||
}
|
||||
|
||||
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
using CalamityMod.Items.Weapons.Melee;
|
||||
using CalamityMod.Projectiles.Typeless;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
@@ -19,23 +21,29 @@ namespace CalamityMod.Projectiles.Melee.Yoyos
|
||||
private static float MaxAuraRadius = 100f;
|
||||
private static float MinDischargeRate = 0.05f;
|
||||
private static float MaxDischargeRate = 0.53f;
|
||||
private static float ChargePerHit = 6f;
|
||||
private static float ChargePerHit = 2.2f;
|
||||
|
||||
private static int AuraBaseDamage = 160;
|
||||
private static int HitsPerOrbVolley = 6;
|
||||
private static int HitsPerOrbVolley = 10;
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("The Oracle");
|
||||
ProjectileID.Sets.YoyosLifeTimeMultiplier[projectile.type] = -1f;
|
||||
ProjectileID.Sets.YoyosMaximumRange[projectile.type] = 800f;
|
||||
ProjectileID.Sets.YoyosTopSpeed[projectile.type] = 24f;
|
||||
|
||||
ProjectileID.Sets.TrailCacheLength[projectile.type] = 8;
|
||||
ProjectileID.Sets.TrailingMode[projectile.type] = 1;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
projectile.CloneDefaults(ProjectileID.Terrarian);
|
||||
aiType = 554;
|
||||
projectile.aiStyle = 99;
|
||||
projectile.width = 20;
|
||||
projectile.height = 20;
|
||||
projectile.scale = 1.2f;
|
||||
projectile.friendly = true;
|
||||
projectile.melee = true;
|
||||
projectile.penetrate = -1;
|
||||
projectile.extraUpdates = 1;
|
||||
@@ -91,6 +99,12 @@ namespace CalamityMod.Projectiles.Melee.Yoyos
|
||||
projectile.netUpdate = true;
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1);
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
|
||||
{
|
||||
// The yoyo does nothing versus normal dummies
|
||||
@@ -190,12 +204,13 @@ namespace CalamityMod.Projectiles.Melee.Yoyos
|
||||
|
||||
if (dist <= radius)
|
||||
{
|
||||
int finalDamage = (int)(baseDamage * owner.meleeDamage * Main.rand.NextFloat(0.85f, 1.15f));
|
||||
bool crit = Main.rand.Next(100) <= owner.meleeCrit + 4;
|
||||
target.StrikeNPC(finalDamage, 0f, 0, crit, false, false);
|
||||
|
||||
if (Main.netMode != NetmodeID.SinglePlayer)
|
||||
NetMessage.SendData(28, -1, -1, null, i, finalDamage, 0f, 0f, crit ? 1 : 0, 0, 0);
|
||||
int finalDamage = (int)(baseDamage * (owner.allDamage + owner.meleeDamage - 1f));
|
||||
if (projectile.owner == Main.myPlayer)
|
||||
{
|
||||
Projectile p = Projectile.NewProjectileDirect(target.Center, Vector2.Zero, ModContent.ProjectileType<DirectStrike>(), finalDamage, 0f, projectile.owner, i);
|
||||
p.melee = true;
|
||||
p.Calamity().forceMelee = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -207,7 +222,7 @@ namespace CalamityMod.Projectiles.Melee.Yoyos
|
||||
|
||||
int numOrbs = 3;
|
||||
int orbID = ModContent.ProjectileType<Orbacle>();
|
||||
int orbDamage = Oracle.BaseDamage * 3;
|
||||
int orbDamage = projectile.damage * 3;
|
||||
float orbKB = 8f;
|
||||
float angleVariance = MathHelper.TwoPi / numOrbs;
|
||||
float spinOffsetAngle = MathHelper.Pi / (2f * numOrbs);
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Projectiles.Typeless
|
||||
{
|
||||
public class DirectStrike : ModProjectile
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Nondescript Damaging Entity");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
projectile.width = 2;
|
||||
projectile.height = 2;
|
||||
projectile.penetrate = 1;
|
||||
projectile.extraUpdates = 0;
|
||||
projectile.ignoreWater = true;
|
||||
projectile.alpha = 255;
|
||||
projectile.timeLeft = 2;
|
||||
}
|
||||
|
||||
// Can only strike the given NPC slot (assuming it's a valid identifier)
|
||||
public override bool? CanHitNPC(NPC target)
|
||||
{
|
||||
if (projectile.ai[0] < 0f || projectile.ai[0] > 199f)
|
||||
return null;
|
||||
return projectile.ai[0] == target.whoAmI;
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 177 B |
Reference in new issue
Block a user