Skip to content

Commit

Permalink
balanced some drones, moved files around
Browse files Browse the repository at this point in the history
  • Loading branch information
direwolf420 committed May 14, 2020
1 parent 3cac96b commit 56bd852
Show file tree
Hide file tree
Showing 22 changed files with 57 additions and 38 deletions.
12 changes: 5 additions & 7 deletions AssPlayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using AssortedCrazyThings.Items;
using AssortedCrazyThings.Items.Weapons;
using AssortedCrazyThings.Projectiles.Minions.CompanionDungeonSouls;
using AssortedCrazyThings.Projectiles.Minions.Drones;
using AssortedCrazyThings.UI;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
Expand Down Expand Up @@ -69,7 +68,8 @@ public class AssPlayer : ModPlayer

public bool droneControllerMinion = false;

public const byte shieldDroneReductionMax = 50;
public const byte shieldDroneReductionMax = 35;
public const byte ShieldIncreaseAmount = 7;
public byte shieldDroneReduction = 0; //percentage * 100
public float shieldDroneLerpVisual = 0; //percentage

Expand Down Expand Up @@ -222,7 +222,7 @@ public void DecreaseDroneShield(ref int damage)
}

damage = (int)(damage * ((100 - shieldDroneReduction) / 100f));
if (Main.netMode != NetmodeID.Server && Main.myPlayer == player.whoAmI) shieldDroneReduction -= ShieldDrone.ShieldIncreaseAmount; //since this is only set clientside by the projectile and synced by packets
if (Main.netMode != NetmodeID.Server && Main.myPlayer == player.whoAmI) shieldDroneReduction -= ShieldIncreaseAmount; //since this is only set clientside by the projectile and synced by packets
}
}

Expand Down Expand Up @@ -859,8 +859,6 @@ public override void ModifyHitNPCWithProj(Projectile proj, NPC target, ref int d
public override void ModifyHitPvp(Item item, Player target, ref int damage, ref bool crit)
{
//ApplyCandleDebuffs(target);
target.GetModPlayer<AssPlayer>().DecreaseDroneShield(ref damage);

target.GetModPlayer<AssPlayer>().ResetEmpoweringTimer();

target.GetModPlayer<AssPlayer>().SpawnSoulTemp();
Expand All @@ -869,8 +867,6 @@ public override void ModifyHitPvp(Item item, Player target, ref int damage, ref
public override void ModifyHitPvpWithProj(Projectile proj, Player target, ref int damage, ref bool crit)
{
//ApplyCandleDebuffs(target);
target.GetModPlayer<AssPlayer>().DecreaseDroneShield(ref damage);

target.GetModPlayer<AssPlayer>().ResetEmpoweringTimer();

target.GetModPlayer<AssPlayer>().SpawnSoulTemp();
Expand Down Expand Up @@ -901,6 +897,8 @@ public override bool PreHurt(bool pvp, bool quiet, ref int damage, ref int hitDi
{
if (getDefenseDuration != 0) damage = 1;

DecreaseDroneShield(ref damage);

if (wyvernCampfire && damageSource.SourceProjectileType == ProjectileID.HarpyFeather)
{
hitDirection = 0; //this cancels knockback
Expand Down
Binary file removed Items/DroneUnlockableBasic.png
Binary file not shown.
Binary file removed Items/DroneUnlockableHealing.png
Binary file not shown.
Binary file removed Items/DroneUnlockableHeavy.png
Binary file not shown.
Binary file removed Items/DroneUnlockableMissile.png
Binary file not shown.
Binary file removed Items/DroneUnlockableShield.png
Binary file not shown.
5 changes: 2 additions & 3 deletions Items/DroneParts.cs → Items/DroneUnlockables/DroneParts.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace AssortedCrazyThings.Items
namespace AssortedCrazyThings.Items.DroneUnlockables
{
//TODO tooltip, sprite
public class DroneParts : ModItem
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Drone Parts");
//TODO tooltip
Tooltip.SetDefault("'You could make use of this'");
}

Expand Down
File renamed without changes
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
using AssortedCrazyThings.Base;
using AssortedCrazyThings.Items.Weapons;
using System.Collections.Generic;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace AssortedCrazyThings.Items
namespace AssortedCrazyThings.Items.DroneUnlockables
{
//TODO Recipes for drone unlockables
public abstract class DroneUnlockables : ModItem
public abstract class DroneUnlockable : ModItem
{
public override void SetDefaults()
{
Expand All @@ -19,8 +17,8 @@ public override void SetDefaults()
item.consumable = true;
item.maxStack = 1;
item.UseSound = SoundID.Item4;
item.useTime = 40;
item.useAnimation = 40;
item.useTime = 30;
item.useAnimation = 30;
item.useStyle = ItemUseStyleID.HoldingUp;
item.value = Item.sellPrice(silver: 50);
}
Expand Down Expand Up @@ -60,13 +58,36 @@ public override bool UseItem(Player player)
if (Main.netMode != NetmodeID.Server && Main.myPlayer == player.whoAmI)
{
player.GetModPlayer<AssPlayer>().droneControllerUnlocked |= UnlockedType;
AssUtils.UIText("Unlocked: " + DroneController.GetDroneData(UnlockedType).Name, CombatText.HealLife);
Main.NewText("Unlocked: " + DroneController.GetDroneData(UnlockedType).Name, CombatText.HealLife);
}
return true;
}

public override void AddRecipes()
{
DroneRecipe recipe = new DroneRecipe(mod, UnlockedType);
recipe.AddIngredient(ModContent.ItemType<DroneParts>());
recipe.SetResult(this);
recipe.AddRecipe();
}
}

public class DroneRecipe : ModRecipe
{
public DroneType UnlockedType;

public DroneRecipe(Mod mod, DroneType unlockedType): base(mod)
{
UnlockedType = unlockedType;
}

public override bool RecipeAvailable()
{
return !Main.LocalPlayer.GetModPlayer<AssPlayer>().droneControllerUnlocked.HasFlag(UnlockedType);
}
}

public class DroneUnlockableBasic : DroneUnlockables
public class DroneUnlockableBasicLaserDrone : DroneUnlockable
{
public override void SetStaticDefaults()
{
Expand All @@ -82,7 +103,7 @@ public override DroneType UnlockedType
}
}

public class DroneUnlockableHeavy : DroneUnlockables
public class DroneUnlockableHeavyLaserDrone : DroneUnlockable
{
public override void SetStaticDefaults()
{
Expand All @@ -98,7 +119,7 @@ public override DroneType UnlockedType
}
}

public class DroneUnlockableMissile : DroneUnlockables
public class DroneUnlockableMissileDrone : DroneUnlockable
{
public override void SetStaticDefaults()
{
Expand All @@ -114,7 +135,7 @@ public override DroneType UnlockedType
}
}

public class DroneUnlockableHealing : DroneUnlockables
public class DroneUnlockableHealingDrone : DroneUnlockable
{
public override void SetStaticDefaults()
{
Expand All @@ -130,7 +151,7 @@ public override DroneType UnlockedType
}
}

public class DroneUnlockableShield : DroneUnlockables
public class DroneUnlockableShieldDrone : DroneUnlockable
{
public override void SetStaticDefaults()
{
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion Items/Pets/HealingDroneItem.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using AssortedCrazyThings.Items.DroneUnlockables;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
Expand Down Expand Up @@ -38,7 +39,7 @@ public override void AddRecipes()
//transformation recipe
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(item.type, 1);
recipe.SetResult(ModContent.ItemType<DroneUnlockableHealing>());
recipe.SetResult(ModContent.ItemType<DroneUnlockableHealingDrone>());
recipe.AddRecipe();
}
}
Expand Down
16 changes: 8 additions & 8 deletions Items/Weapons/DroneController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,8 @@ public static DroneData SetDroneData(DroneType selected)
desc: "Fires a salvo of missiles after a long delay",
misc: "Occupies two minion slots",
firerate: "Very slow",
dmgModifier: 0.2f,
kBModifier: 1.333334f
dmgModifier: 2.19f,
kBModifier: 1.2f
);
case DroneType.Healing:
return new DroneData
Expand All @@ -182,7 +182,7 @@ public static DroneData SetDroneData(DroneType selected)
(
projType: ModContent.ProjectileType<ShieldDrone>(),
name: "Shield Drone",
desc: "Creates a damage reducing shield",
desc: "Creates a damage reducing shield over time",
misc: "Only one can be summoned\nShield resets if drone despawns",
combat: false
);
Expand Down Expand Up @@ -274,8 +274,8 @@ public override void SetDefaults()
item.mana = 10;
item.width = 28;
item.height = 30;
item.useTime = 36;
item.useAnimation = 36;
item.useTime = 30;
item.useAnimation = 30;
item.useStyle = ItemUseStyleID.HoldingUp;
item.noMelee = true;
item.noUseGraphic = true;
Expand Down Expand Up @@ -399,7 +399,7 @@ public override void ModifyTooltips(List<TooltipLine> tooltips)

if (!(allUnlocked && hasController))
{
tooltips.Add(new TooltipLine(mod, "Destroyer", "Defeat the destroyer to unlock more drones"));
tooltips.Add(new TooltipLine(mod, "Destroyer", "Defeat The Destroyer to unlock more drones"));
}

CanSpawn(Main.LocalPlayer, selected, out bool blocked);
Expand Down Expand Up @@ -427,7 +427,7 @@ public string PreviewTextureName
{
get
{
return "Projectiles/Minions/Drones/" + Name.Replace(" ", "") + "Preview";
return "Items/DroneUnlockables/DroneUnlockable" + Name.Replace(" ", "");
}
}

Expand All @@ -439,7 +439,7 @@ public DroneData(int projType, string name, string desc, string misc = "", strin
KBModifier = kBModifier;
Firerate = firerate;
string stats = combat ? ("\nBase Damage: " + (int)(DroneController.BaseDmg * (DmgModifier + 1f))
+ "\nBase Knockback: " + Math.Round(DroneController.BaseKB * (KBModifier + 1f), 1)) : "";
+ "\nBase Knockback: " + Math.Round(DroneController.BaseKB * KBModifier, 1)) : "";
UITooltip = Name + stats + "\n" + desc + "\n" + misc;
Combat = combat;
}
Expand Down
1 change: 1 addition & 0 deletions NPCs/AssGlobalNPC.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using AssortedCrazyThings.Base;
using AssortedCrazyThings.Items;
using AssortedCrazyThings.Items.DroneUnlockables;
using AssortedCrazyThings.Items.Pets;
using AssortedCrazyThings.Items.Placeable;
using AssortedCrazyThings.Items.Weapons;
Expand Down
Binary file removed Projectiles/Minions/Drones/BasicLaserDronePreview.png
Binary file not shown.
Binary file modified Projectiles/Minions/Drones/BasicLaserDrone_Lower.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion Projectiles/Minions/Drones/MissileDrone.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class MissileDrone : DroneBase
{
private static readonly string nameGlow = "Projectiles/Minions/Drones/" + "MissileDrone_Glowmask";

public const int AttackCooldown = 180; //120 but incremented by 1.5f
public const int AttackCooldown = 360; //120 but incremented by 1.5f
public const int AttackDelay = 60;
public const int AttackDuration = 60;

Expand Down
11 changes: 5 additions & 6 deletions Projectiles/Minions/Drones/ShieldDrone.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ public class ShieldDrone : DroneBase
private static readonly string nameLamps = "Projectiles/Minions/Drones/" + "ShieldDrone_Lamps";
private static readonly string nameLower = "Projectiles/Minions/Drones/" + "ShieldDrone_Lower";
private float addRotation; //same
private const int ShieldDelay = 180;
public const byte ShieldIncreaseAmount = 10;
private const int ShieldDelay = 360;
private float LowerOutPercent = 0f;

private float ShieldCounter
Expand Down Expand Up @@ -46,7 +45,7 @@ private int Stage
get
{
AssPlayer mPlayer = projectile.GetOwner().GetModPlayer<AssPlayer>();
return mPlayer.shieldDroneReduction / 10;
return mPlayer.shieldDroneReduction / AssPlayer.ShieldIncreaseAmount;
}
}

Expand Down Expand Up @@ -197,13 +196,13 @@ protected override void CustomAI()
if (ShieldCounter > ShieldDelay)
{
ShieldCounter = 0;
if (RealOwner) mPlayer.shieldDroneReduction += ShieldIncreaseAmount;
CombatText.NewText(player.getRect(), Color.LightBlue, ShieldIncreaseAmount);
if (RealOwner) mPlayer.shieldDroneReduction += AssPlayer.ShieldIncreaseAmount;
CombatText.NewText(player.getRect(), Color.LightBlue, AssPlayer.ShieldIncreaseAmount);
AssUtils.QuickDustLine(16, shootOrigin, target, between.Length() / 3, Color.White, alpha: 120, scale: 1.5f);
}
}
}
else //if above 50%, addRotation should go down to projectile.rotation
else //if fully shielded, addRotation should go down to projectile.rotation
{
addRotation = addRotation.AngleLerp(projectile.rotation, 0.1f);
}
Expand Down
Binary file removed Projectiles/Minions/Drones/ShieldDrone_Back.png
Binary file not shown.

0 comments on commit 56bd852

Please sign in to comment.