mirror of
https://github.com/YouHaveTrouble/YHTMod.git
synced 2026-05-11 21:56:54 +00:00
adapt ooga booga C# code style
This commit is contained in:
@@ -26,7 +26,7 @@ public class ArcaneMissile : ModItem
|
||||
|
||||
public override void UpdateAccessory(Player player, bool hideVisual)
|
||||
{
|
||||
player.GetModPlayer<YhtPlayer>().arcaneMissle = Item.damage;
|
||||
player.GetModPlayer<YhtPlayer>().ArcaneMissle = Item.damage;
|
||||
|
||||
base.UpdateAccessory(player, hideVisual);
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ public class ArcaneMissileBehavior : GlobalNPC
|
||||
|
||||
var player = Main.LocalPlayer;
|
||||
|
||||
if (player.GetModPlayer<YhtPlayer>().arcaneMissle != 0 && projectile.DamageType == DamageClass.Magic)
|
||||
if (player.GetModPlayer<YhtPlayer>().ArcaneMissle != 0 && projectile.DamageType == DamageClass.Magic)
|
||||
{
|
||||
// player just crit with magic weapon while having arcane missile accessory
|
||||
var proj = Projectile.NewProjectileDirect(
|
||||
@@ -29,7 +29,7 @@ public class ArcaneMissileBehavior : GlobalNPC
|
||||
Main.LocalPlayer.position,
|
||||
npc.position.DirectionFrom(Main.LocalPlayer.position),
|
||||
ProjectileID.MagicMissile,
|
||||
player.GetModPlayer<YhtPlayer>().arcaneMissle,
|
||||
player.GetModPlayer<YhtPlayer>().ArcaneMissle,
|
||||
0,
|
||||
Main.LocalPlayer.whoAmI
|
||||
);
|
||||
|
||||
@@ -5,12 +5,15 @@ using YHTMod.Projectiles.Weapons;
|
||||
|
||||
namespace YHTMod.Items;
|
||||
|
||||
public class CopperSwordOnAStick : ModItem {
|
||||
public override void SetStaticDefaults() {
|
||||
public class CopperSwordOnAStick : ModItem
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
CreativeItemSacrificesCatalog.Instance.SacrificeCountNeededByItemId[Type] = 1;
|
||||
}
|
||||
|
||||
public override void SetDefaults() {
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.DamageType = DamageClass.Melee;
|
||||
Item.damage = 3;
|
||||
Item.width = 80;
|
||||
@@ -31,11 +34,12 @@ public class CopperSwordOnAStick : ModItem {
|
||||
Item.shoot = ModContent.ProjectileType<CopperSwordOnAStickProjectile>();
|
||||
}
|
||||
|
||||
public override void AddRecipes() {
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe()
|
||||
.AddIngredient(ItemID.Wood, 5)
|
||||
.AddIngredient(ItemID.Rope, 5)
|
||||
.AddIngredient(ItemID.CopperShortsword)
|
||||
.Register();
|
||||
}
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -25,8 +25,8 @@ public class KatanaRedo : GlobalItem
|
||||
if (item.type != ItemID.Katana || player.altFunctionUse != 2) return null;
|
||||
var yhtPlayer = player.GetModPlayer<YhtPlayer>();
|
||||
|
||||
if (yhtPlayer.katanaTeleportCooldown > 0) return null;
|
||||
yhtPlayer.katanaTeleportCooldown = 300;
|
||||
if (yhtPlayer.KatanaTeleportCooldown > 0) return null;
|
||||
yhtPlayer.KatanaTeleportCooldown = 300;
|
||||
|
||||
for (var i = 0; i < Main.maxNPCs; i++)
|
||||
{
|
||||
|
||||
@@ -5,12 +5,15 @@ using YHTMod.Projectiles.Weapons;
|
||||
|
||||
namespace YHTMod.Items;
|
||||
|
||||
public class MithrilPebbleOfPigSmiting : ModItem {
|
||||
public override void SetStaticDefaults() {
|
||||
public class MithrilPebbleOfPigSmiting : ModItem
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
CreativeItemSacrificesCatalog.Instance.SacrificeCountNeededByItemId[Type] = 1;
|
||||
}
|
||||
|
||||
public override void SetDefaults() {
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.DamageType = DamageClass.Ranged;
|
||||
Item.damage = 16;
|
||||
Item.width = 8;
|
||||
@@ -30,4 +33,4 @@ public class MithrilPebbleOfPigSmiting : ModItem {
|
||||
Item.shootSpeed = 20f;
|
||||
Item.shoot = ModContent.ProjectileType<MithrilPebbleOfPigSmitingProjectile>();
|
||||
}
|
||||
}
|
||||
}
|
||||
+16
-10
@@ -7,17 +7,20 @@ using Terraria.ModLoader;
|
||||
using YHTMod.Buffs;
|
||||
using YHTMod.Projectiles.Weapons;
|
||||
|
||||
namespace YHTMod.Items;
|
||||
namespace YHTMod.Items;
|
||||
|
||||
public class ToclafaneStaff : ModItem {
|
||||
|
||||
public override void SetStaticDefaults() {
|
||||
ItemID.Sets.GamepadWholeScreenUseRange[Item.type] = true; // This lets the player target anywhere on the whole screen while using a controller.
|
||||
public class ToclafaneStaff : ModItem
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
ItemID.Sets.GamepadWholeScreenUseRange[Item.type] =
|
||||
true; // This lets the player target anywhere on the whole screen while using a controller.
|
||||
ItemID.Sets.LockOnIgnoresCollision[Item.type] = true;
|
||||
CreativeItemSacrificesCatalog.Instance.SacrificeCountNeededByItemId[Type] = 1;
|
||||
}
|
||||
|
||||
public override void SetDefaults() {
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.damage = 30;
|
||||
Item.knockBack = 3f;
|
||||
Item.mana = 10;
|
||||
@@ -35,13 +38,16 @@ public class ToclafaneStaff : ModItem {
|
||||
Item.shoot = ModContent.ProjectileType<ToclafaneMinion>();
|
||||
}
|
||||
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) {
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity,
|
||||
int type, int damage, float knockback)
|
||||
{
|
||||
player.AddBuff(Item.buffType, 2);
|
||||
position = Main.MouseWorld;
|
||||
return base.Shoot(player, source, position, velocity, type, damage, knockback);
|
||||
}
|
||||
|
||||
public override void AddRecipes() {
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe()
|
||||
.AddIngredient(ItemID.GuideVoodooDoll, 1)
|
||||
.AddIngredient(ItemID.HallowedBar, 15)
|
||||
@@ -79,4 +85,4 @@ public class ToclafaneStaff : ModItem {
|
||||
.AddTile(TileID.MythrilAnvil)
|
||||
.Register();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user