Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Buffs/MirrorBarrier.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public override void SetDefaults()

public override void Update(Player player, ref int buffIndex)
{
PlayerFX p = player.GetModPlayer<PlayerFX>(mod);
PlayerFX p = player.GetModPlayer<PlayerFX>();
p.reflectingProjectiles = true;
}
}
Expand Down
2 changes: 1 addition & 1 deletion Buffs/RapidRecovery.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public static void HealDamage(Player player, Mod mod, double damage)
public static void HealDamage(Player player, Mod mod, int damage)
{
int time = (int)(damage * (120f / healthPer2Secs));
int id = mod.BuffType<RapidRecovery>();
int id = ModContent.BuffType<RapidRecovery>();
player.AddBuff(id, time, false);
}
}
Expand Down
18 changes: 9 additions & 9 deletions Buffs/SabreDance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,21 @@ public override void SetDefaults()

public override void Update(Player player, ref int buffIndex)
{
if (player.buffTime[buffIndex] >= 2)
{
player.meleeSpeed += 2f;
if (player.buffTime[buffIndex] >= 2)
{
player.meleeSpeed += 2f;
}
player.itemAnimation = Math.Min(player.itemAnimation, player.itemAnimationMax);
if(player.itemAnimation <= 1)
{
if(player.itemAnimation <= 1)
{
player.HeldItem.useStyle = 1;
player.controlUseItem = true;
player.controlUseItem = true;
}
}

public static void ApplySabreDance(Mod mod, Player player, int extraStrikes)
{
player.AddBuff(mod.BuffType<SabreDance>(), 2 + (extraStrikes * player.itemAnimationMax / 3));
public static void ApplySabreDance(Mod mod, Player player, int extraStrikes)
{
player.AddBuff(ModContent.BuffType<SabreDance>(), 2 + (extraStrikes * player.itemAnimationMax / 3));
}
}
}
38 changes: 19 additions & 19 deletions Buffs/SpiritGuardian.cs
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
using Terraria;
using Terraria.ModLoader;

namespace WeaponOut.Buffs
{
public class SpiritGuardian : ModBuff
{
public override void SetDefaults()
{
DisplayName.SetDefault("Starlight Guardian");
Description.SetDefault("The starlight guardian will assist you");
Main.buffNoTimeDisplay[Type] = true;
}
public override void Update(Player player, ref int buffIndex)
using Terraria;
using Terraria.ModLoader;

namespace WeaponOut.Buffs
{
public class SpiritGuardian : ModBuff
{
public override void SetDefaults()
{
int guardianID = mod.ProjectileType<Projectiles.SpiritGuardian>();
player.GetModPlayer<PlayerFX>().starlightGuardian = player.ownedProjectileCounts[guardianID] > 0;
}
}
}
DisplayName.SetDefault("Starlight Guardian");
Description.SetDefault("The starlight guardian will assist you");
Main.buffNoTimeDisplay[Type] = true;
}
public override void Update(Player player, ref int buffIndex)
{
int guardianID = ModContent.ProjectileType<Projectiles.SpiritGuardian>();
player.GetModPlayer<PlayerFX>().starlightGuardian = player.ownedProjectileCounts[guardianID] > 0;
}
}
}
2 changes: 1 addition & 1 deletion Items/Accessories/AccretionEmblem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public override void UpdateAccessory(Player player, bool hideVisual)
player.statManaMax2 += 20;
if (hideVisual) return;
HeliosphereEmblem.DustVisuals(player, DustID.PinkFlame, 2f);
player.GetModPlayer<PlayerFX>(mod).lunarMagicVisual = true;
player.GetModPlayer<PlayerFX>().lunarMagicVisual = true;
}
}
}
4 changes: 2 additions & 2 deletions Items/Accessories/ChaosHook.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ public override void AddRecipes()
{
if (!ModConf.EnableAccessories) return;
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(mod.ItemType<DiscordHook>(), 1);
recipe.AddIngredient(ModContent.ItemType<DiscordHook>(), 1);
recipe.SetResult(this);
recipe.AddRecipe();
//Conversion from
recipe = new ModRecipe(mod);
recipe.AddIngredient(this, 1);
recipe.SetResult(mod.ItemType<DiscordHook>());
recipe.SetResult(ModContent.ItemType<DiscordHook>());
recipe.AddRecipe();
}
}
Expand Down
2 changes: 1 addition & 1 deletion Items/Accessories/HyperSash.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public override void SetDefaults()
public override void AddRecipes() {
if (!ModConf.EnableFists) return;
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(mod.ItemType<FightingSash>(), 1);
recipe.AddIngredient(ModContent.ItemType<FightingSash>(), 1);
recipe.AddIngredient(ItemID.ChlorophyteBar, 2);
recipe.AddTile(TileID.Loom);
recipe.SetResult(this, 1);
Expand Down
16 changes: 8 additions & 8 deletions Items/Accessories/LunarEmblem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ public override void SetDefaults()
public override void AddRecipes() {
if (!ModConf.EnableEmblems) return;
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(mod.ItemType<HeliosphereEmblem>());
recipe.AddIngredient(mod.ItemType<WormholeEmblem>());
recipe.AddIngredient(mod.ItemType<AccretionEmblem>());
recipe.AddIngredient(mod.ItemType<PerihelionEmblem>());
recipe.AddIngredient(mod.ItemType<SupernovaEmblem>());
recipe.AddIngredient(ModContent.ItemType<HeliosphereEmblem>());
recipe.AddIngredient(ModContent.ItemType<WormholeEmblem>());
recipe.AddIngredient(ModContent.ItemType<AccretionEmblem>());
recipe.AddIngredient(ModContent.ItemType<PerihelionEmblem>());
recipe.AddIngredient(ModContent.ItemType<SupernovaEmblem>());
recipe.AddTile(TileID.LunarCraftingStation);
recipe.SetResult(this, 1);
recipe.AddRecipe();
Expand All @@ -60,9 +60,9 @@ public override void UpdateAccessory(Player player, bool hideVisual)
player.thrownVelocity += 0.3f;
player.maxMinions += 1;
if (hideVisual) return;
player.GetModPlayer<PlayerFX>(mod).lunarRangeVisual = true;
player.GetModPlayer<PlayerFX>(mod).lunarMagicVisual = true;
player.GetModPlayer<PlayerFX>(mod).lunarThrowVisual = true;
player.GetModPlayer<PlayerFX>().lunarRangeVisual = true;
player.GetModPlayer<PlayerFX>().lunarMagicVisual = true;
player.GetModPlayer<PlayerFX>().lunarThrowVisual = true;

Vector2 hand = Main.OffsetsPlayerOnhand[player.bodyFrame.Y / 56] * 2f;
if (player.direction != 1) {
Expand Down
135 changes: 68 additions & 67 deletions Items/Accessories/MirrorBadge.cs
Original file line number Diff line number Diff line change
@@ -1,72 +1,73 @@
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.Localization;
namespace WeaponOut.Items.Accessories
{
public class MirrorBadge : ModItem
{
public const int reflectDelay = 90;
public override void SetStaticDefaults()
{
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.Localization;

namespace WeaponOut.Items.Accessories
{
public class MirrorBadge : ModItem
{
public const int reflectDelay = 90;

public override void SetStaticDefaults()
{
DisplayName.SetDefault("Mirror Badge");
DisplayName.AddTranslation(GameCulture.Chinese, "镜之徽章");
DisplayName.AddTranslation(GameCulture.Russian, "Зеркальная Медаль");
Tooltip.SetDefault(
"Immunity to petrification\n" +
"Reflects most projectiles\n" +
DisplayName.AddTranslation(GameCulture.Russian, "Зеркальная Медаль");

Tooltip.SetDefault(
"Immunity to petrification\n" +
"Reflects most projectiles\n" +
"'A mark of courage, polished to perfection'");
Tooltip.AddTranslation(GameCulture.Chinese, "免疫石化\n反射大多数抛射物\n“勇气的印记,极致的抛光”");
Tooltip.AddTranslation(GameCulture.Russian,
"Иммунитет к окаменению\n" +
"Отражает большинство снарядов\n" +
"'Тщательно отполированный знак отваги'");
Tooltip.AddTranslation(GameCulture.Russian,
"Иммунитет к окаменению\n" +
"Отражает большинство снарядов\n" +
"'Тщательно отполированный знак отваги'");

}
public override void SetDefaults()
{
item.width = 18;
item.height = 20;
item.rare = 8;
item.value = Item.sellPrice(0, 3, 0, 0);
item.accessory = true;
}
public override void AddRecipes() {
if (!ModConf.EnableAccessories) return;
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ItemID.PocketMirror, 1);
recipe.AddIngredient(ItemID.ShroomiteBar, 12);
recipe.AddTile(TileID.MythrilAnvil);
recipe.SetResult(this, 1);
recipe.AddRecipe();
}

public override void UpdateAccessory(Player player, bool hideVisual)
{
player.buffImmune[BuffID.Stoned] = true;

PlayerFX pFX = player.GetModPlayer<PlayerFX>();
if (pFX.reflectingProjectileDelay <= 0)
{
player.AddBuff(WeaponOut.BuffIDMirrorBarrier, 2);
}
}

public override bool PreDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, ref float rotation, ref float scale, int whoAmI)
{
if (Main.rand.Next(15) == 0)
{
int dustIndex = Dust.NewDust(item.position, item.width, item.height, 43, 0, 0, 100, Color.White, 0.3f);
Main.dust[dustIndex].velocity *= 0.1f;
Main.dust[dustIndex].fadeIn = 1f;
}
return true;
}

}
public override void SetDefaults()
{
item.width = 18;
item.height = 20;
item.rare = 8;
item.value = Item.sellPrice(0, 3, 0, 0);
item.accessory = true;
}
public override void AddRecipes() {
if (!ModConf.EnableAccessories) return;
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ItemID.PocketMirror, 1);
recipe.AddIngredient(ItemID.ShroomiteBar, 12);
recipe.AddTile(TileID.MythrilAnvil);
recipe.SetResult(this, 1);
recipe.AddRecipe();
}

public override void UpdateAccessory(Player player, bool hideVisual)
{
player.buffImmune[BuffID.Stoned] = true;

PlayerFX pFX = player.GetModPlayer<PlayerFX>(mod);
if (pFX.reflectingProjectileDelay <= 0)
{
player.AddBuff(WeaponOut.BuffIDMirrorBarrier, 2);
}
}

public override bool PreDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, ref float rotation, ref float scale, int whoAmI)
{
if (Main.rand.Next(15) == 0)
{
int dustIndex = Dust.NewDust(item.position, item.width, item.height, 43, 0, 0, 100, Color.White, 0.3f);
Main.dust[dustIndex].velocity *= 0.1f;
Main.dust[dustIndex].fadeIn = 1f;
}
return true;
}
}
}
}
}
2 changes: 1 addition & 1 deletion Items/Accessories/Pavise.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public override void AddRecipes() {

public override void UpdateAccessory(Player player, bool hideVisual)
{
PlayerFX modPlayer = player.GetModPlayer<PlayerFX>(mod);
PlayerFX modPlayer = player.GetModPlayer<PlayerFX>();
modPlayer.FrontDefence += 10;
modPlayer.frontNoKnockback = true;
}
Expand Down
Loading