mirror of
https://github.com/YouHaveTrouble/YHTMod.git
synced 2026-05-11 21:56:54 +00:00
Compare commits
47 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 6f19bfa65f | |||
| 7925364a3d | |||
| 1bfc61e5aa | |||
| b9fc65dab2 | |||
| a1cc627246 | |||
| af61713ae4 | |||
| f208eab5be | |||
| 54ae566a89 | |||
| 62ae36d4f0 | |||
| ab37d7e410 | |||
| 4aebc3a261 | |||
| d006a3fbaf | |||
| e4a046734e | |||
| a40a3b624d | |||
| a338e92742 | |||
| a68b762f0a | |||
| a545325b12 | |||
| 09a89e7ed5 | |||
| 28f132aca3 | |||
| 808ce1ca15 | |||
| 27898f341a | |||
| 2511d7bfd0 | |||
| c29ac8272f | |||
| 9e1c05df46 | |||
| 2dd603eb81 | |||
| fff8b5e7f1 | |||
| a945f17711 | |||
| 9cb093d8df | |||
| 65690a59f5 | |||
| 8bc637b9b8 | |||
| e797f803c1 | |||
| ab5c5a2d84 | |||
| b252a8e3a0 | |||
| c82f4648e9 | |||
| 50d7f8b0d2 | |||
| ee06338f22 | |||
| cc2849737c | |||
| e3f74c2e21 | |||
| cc6d8d6dc2 | |||
| e300c3cddb | |||
| 8a9730f61f | |||
| 4819ceee25 | |||
| f46e4e1673 | |||
| bf556d059f | |||
| eb1bf9014d | |||
| 4a0f37f652 | |||
| 68025dd762 |
@@ -0,0 +1,18 @@
|
||||
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace YHTMod.Buffs;
|
||||
|
||||
public class ShroomGlowDebuff : ModBuff {
|
||||
public override void SetStaticDefaults() {
|
||||
Main.debuff[Type] = true;
|
||||
}
|
||||
|
||||
public override void Update(NPC npc, ref int buffIndex) {
|
||||
if (Main.netMode == NetmodeID.MultiplayerClient || Main.netMode == NetmodeID.SinglePlayer) { // client-only
|
||||
Lighting.AddLight(npc.Center, 0.1f, 0.3f, 0.6f);
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.6 KiB |
@@ -0,0 +1,31 @@
|
||||
using Terraria;
|
||||
using Terraria.Localization;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace YHTMod.Buffs;
|
||||
|
||||
public class SummonerAmbitionBuff : ModBuff {
|
||||
public override void SetStaticDefaults() {
|
||||
Main.buffNoSave[Type] = true;
|
||||
Main.buffNoTimeDisplay[Type] = true;
|
||||
}
|
||||
|
||||
public override void ModifyBuffText(ref string buffName, ref string tip, ref int rare) {
|
||||
YhtPlayer modPlayer = Main.LocalPlayer.TryGetModPlayer(out YhtPlayer mp) ? mp : null;
|
||||
if (modPlayer == null) return;
|
||||
tip = Language.GetTextValue("Mods.YHTMod.Buffs.SummonerAmbitionBuff.Description",
|
||||
modPlayer.SummonerAmbitions.Count);
|
||||
}
|
||||
|
||||
public override void Update(Player player, ref int buffIndex) {
|
||||
YhtPlayer modPlayer = player.GetModPlayer<YhtPlayer>();
|
||||
|
||||
if (modPlayer.SummonerAmbition) {
|
||||
player.buffTime[buffIndex] = 18000;
|
||||
}
|
||||
else {
|
||||
player.DelBuff(buffIndex);
|
||||
buffIndex--;
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 693 B |
@@ -5,10 +5,7 @@ using YHTMod.Projectiles.Weapons;
|
||||
namespace YHTMod.Buffs;
|
||||
|
||||
public class ToclafaneMinionBuff : ModBuff {
|
||||
|
||||
public override void SetStaticDefaults() {
|
||||
DisplayName.SetDefault("Summon Toclafane");
|
||||
Description.SetDefault("It came from a parallel world to fight for its Master.");
|
||||
Main.buffNoSave[Type] = true;
|
||||
Main.buffNoTimeDisplay[Type] = true;
|
||||
}
|
||||
@@ -16,7 +13,8 @@ public class ToclafaneMinionBuff : ModBuff {
|
||||
public override void Update(Player player, ref int buffIndex) {
|
||||
if (player.ownedProjectileCounts[ModContent.ProjectileType<ToclafaneMinion>()] > 0) {
|
||||
player.buffTime[buffIndex] = 18000;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
player.DelBuff(buffIndex);
|
||||
buffIndex--;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
using Terraria;
|
||||
using Terraria.Localization;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace YHTMod.Buffs;
|
||||
|
||||
public class WarriorAmbitionBuff : ModBuff {
|
||||
public override void SetStaticDefaults() {
|
||||
Main.buffNoSave[Type] = true;
|
||||
Main.buffNoTimeDisplay[Type] = true;
|
||||
}
|
||||
|
||||
public override void ModifyBuffText(ref string buffName, ref string tip, ref int rare) {
|
||||
YhtPlayer modPlayer = Main.LocalPlayer.TryGetModPlayer(out YhtPlayer mp) ? mp : null;
|
||||
if (modPlayer == null) return;
|
||||
tip = Language.GetTextValue("Mods.YHTMod.Buffs.WarriorAmbitionBuff.Description",
|
||||
modPlayer.WarriorAmbitions.Count);
|
||||
}
|
||||
|
||||
public override void Update(Player player, ref int buffIndex) {
|
||||
YhtPlayer modPlayer = player.GetModPlayer<YhtPlayer>();
|
||||
|
||||
if (modPlayer.WarriorAmbition) {
|
||||
player.buffTime[buffIndex] = 18000;
|
||||
}
|
||||
else {
|
||||
player.DelBuff(buffIndex);
|
||||
buffIndex--;
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 621 B |
@@ -0,0 +1,95 @@
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.Chat;
|
||||
using Terraria.ID;
|
||||
using Terraria.Localization;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace YHTMod.Changes;
|
||||
|
||||
[ExtendsFromMod("CalamityMod")]
|
||||
public class BossKillListener : GlobalNPC {
|
||||
|
||||
private static readonly Dictionary<int, string> BossIds = new();
|
||||
|
||||
public override void Load() {
|
||||
BossIds.Add(NPCID.KingSlime, "king_slime");
|
||||
BossIds.Add(NPCID.EyeofCthulhu, "eye_of_cthulhu");
|
||||
BossIds.Add(NPCID.EaterofWorldsHead, "eater_of_worlds");
|
||||
BossIds.Add(NPCID.EaterofWorldsBody, "eater_of_worlds");
|
||||
BossIds.Add(NPCID.EaterofWorldsTail, "eater_of_worlds");
|
||||
BossIds.Add(NPCID.BrainofCthulhu, "brain_of_cthulhu");
|
||||
BossIds.Add(NPCID.Deerclops, "deerclops");
|
||||
BossIds.Add(NPCID.QueenBee, "queen_bee");
|
||||
BossIds.Add(NPCID.SkeletronHead, "skeletron");
|
||||
BossIds.Add(NPCID.WallofFlesh, "wall_of_flesh");
|
||||
|
||||
Mod calamity = CalamityHelper.GetCalamityMod();
|
||||
if (calamity == null) return;
|
||||
if (calamity.TryFind("DesertScourgeHead", out ModNPC desertScourgeHead)) {
|
||||
BossIds.Add(desertScourgeHead.Type, "desert_scourge");
|
||||
}
|
||||
if (calamity.TryFind("Crabulon", out ModNPC crabulon)) {
|
||||
BossIds.Add(crabulon.Type, "crabulon");
|
||||
}
|
||||
if (calamity.TryFind("PerforatorHive", out ModNPC perforatorHive)) {
|
||||
BossIds.Add(perforatorHive.Type, "perforators");
|
||||
}
|
||||
if (calamity.TryFind("HiveMind", out ModNPC hiveMind)) {
|
||||
BossIds.Add(hiveMind.Type, "hive_mind");
|
||||
}
|
||||
if (calamity.TryFind("SlimeGodCore", out ModNPC slimeGodCore)) {
|
||||
BossIds.Add(slimeGodCore.Type, "slime_god");
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnKill(NPC npc) {
|
||||
string id = BossIds.GetValueOrDefault(npc.type, null);
|
||||
switch (id) {
|
||||
case null:
|
||||
base.OnKill(npc);
|
||||
return;
|
||||
case "eater_of_worlds": {
|
||||
int foundEaterSegments = 0;
|
||||
foreach (NPC activeNpC in Main.ActiveNPCs) {
|
||||
if (activeNpC.friendly || activeNpC.townNPC) continue;
|
||||
if (activeNpC.type is not NPCID.EaterofWorldsBody
|
||||
and not NPCID.EaterofWorldsHead
|
||||
and not NPCID.EaterofWorldsTail
|
||||
) continue;
|
||||
if (++foundEaterSegments > 1) break;
|
||||
}
|
||||
if (foundEaterSegments > 1) {
|
||||
base.OnKill(npc);
|
||||
return;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
HandleBossKill(npc, id);
|
||||
base.OnKill(npc);
|
||||
}
|
||||
|
||||
private static void HandleBossKill(NPC npc, string bossKey) {
|
||||
foreach (Player player in Main.ActivePlayers) {
|
||||
YhtPlayer modPlayer = player.GetModPlayer<YhtPlayer>();
|
||||
if (!npc.playerInteraction[player.whoAmI]) continue;
|
||||
|
||||
if (modPlayer.SummonerAmbition && modPlayer.SummonerAmbitions.Add(bossKey)) {
|
||||
ChatHelper.SendChatMessageToClient(
|
||||
NetworkText.FromLiteral("Your Summoner Ambition's potential grows stronger!"),
|
||||
Color.MediumPurple,
|
||||
player.whoAmI
|
||||
);
|
||||
} else if (modPlayer.WarriorAmbition && modPlayer.WarriorAmbitions.Add(bossKey)) {
|
||||
ChatHelper.SendChatMessageToClient(
|
||||
NetworkText.FromLiteral("Your Warrior Ambition's potential grows stronger!"),
|
||||
Color.OrangeRed,
|
||||
player.whoAmI
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
using System.Collections.Generic;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace YHTMod.Changes;
|
||||
|
||||
[ExtendsFromMod("CalamityMod")]
|
||||
public class CalamityHelper {
|
||||
|
||||
public static readonly CalamityHelper Instance = new();
|
||||
|
||||
private static Dictionary<string, int> _bossIconIds;
|
||||
|
||||
private static Mod _calamity;
|
||||
|
||||
private CalamityHelper() {
|
||||
ModLoader.TryGetMod("CalamityMod", out Mod calamity);
|
||||
_calamity = calamity;
|
||||
if (_calamity == null) return;
|
||||
|
||||
_bossIconIds = new Dictionary<string, int> {
|
||||
{ "desert_scourge", ModContent.TryFind("CalamityMod", "LoreDesertScourge", out ModItem item1) ? item1.Type : -1 },
|
||||
{ "crabulon", ModContent.TryFind("CalamityMod", "LoreCrabulon", out ModItem item2) ? item2.Type : -1 },
|
||||
{ "perforators", ModContent.TryFind("CalamityMod", "LorePerforators", out ModItem item3) ? item3.Type : -1 },
|
||||
{ "hive_mind", ModContent.TryFind("CalamityMod", "LoreHiveMind", out ModItem item4) ? item4.Type : -1 },
|
||||
{ "slime_god", ModContent.TryFind("CalamityMod", "LoreSlimeGod", out ModItem item5) ? item5.Type : -1 }
|
||||
};
|
||||
}
|
||||
|
||||
public static int GetBossIconId(string bossKey) {
|
||||
return _bossIconIds.GetValueOrDefault(bossKey, -1);
|
||||
}
|
||||
|
||||
public static Mod GetCalamityMod() {
|
||||
return _calamity;
|
||||
}
|
||||
|
||||
}
|
||||
+9
-5
@@ -1,24 +1,28 @@
|
||||
|
||||
using Terraria;
|
||||
using Terraria.GameContent.ItemDropRules;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using YHTMod.Items;
|
||||
using YHTMod.Items.ArcaneMissile;
|
||||
|
||||
|
||||
namespace YHTMod.Changes;
|
||||
|
||||
public class NpcLoot : GlobalNPC
|
||||
{
|
||||
public class NpcLoot : GlobalNPC {
|
||||
public override void ModifyNPCLoot(NPC npc, NPCLoot npcLoot) {
|
||||
int id = npc.type;
|
||||
|
||||
if (NPCID.Sets.CountsAsCritter[id]) {
|
||||
npcLoot.Add(ItemDropRule.Common(ModContent.ItemType<MithrilPebbleOfPigSmiting>(), 400, 1, 1));
|
||||
npcLoot.Add(ItemDropRule.Common(ModContent.ItemType<MithrilPebbleOfPigSmiting>(), 400));
|
||||
}
|
||||
|
||||
if (NPCID.Plantera == id) {
|
||||
switch (id) {
|
||||
case NPCID.Plantera:
|
||||
npcLoot.Add(ItemDropRule.Common(ItemID.ChlorophyteOre, 1, 60, 80));
|
||||
break;
|
||||
case NPCID.Tim:
|
||||
npcLoot.Add(ItemDropRule.Common(ModContent.ItemType<ArcaneMissile>()));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,150 @@
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using YHTMod.Buffs;
|
||||
using Vector2 = Microsoft.Xna.Framework.Vector2;
|
||||
|
||||
namespace YHTMod.Changes;
|
||||
|
||||
[ExtendsFromMod("CalamityMod")]
|
||||
public class SummonerOnHitEffects : GlobalProjectile {
|
||||
|
||||
public override void OnSpawn(Projectile projectile, IEntitySource source) {
|
||||
Mod calamity = CalamityHelper.GetCalamityMod();
|
||||
|
||||
if (calamity is null
|
||||
|| source is not EntitySource_Parent { Entity: Projectile { friendly: true } parentProj }
|
||||
|| parentProj.hostile
|
||||
) {
|
||||
base.OnSpawn(projectile, source);
|
||||
return;
|
||||
}
|
||||
|
||||
// Get Calamity projectile types safely
|
||||
if (!calamity.TryFind("ShadeNimbusHostile", out ModProjectile shadeNimbus)
|
||||
|| parentProj.type != shadeNimbus.Type
|
||||
) {
|
||||
base.OnSpawn(projectile, source);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!calamity.TryFind("ShaderainHostile", out ModProjectile shaderainHostile) ||
|
||||
projectile.type != shaderainHostile.Type) {
|
||||
base.OnSpawn(projectile, source);
|
||||
return;
|
||||
}
|
||||
|
||||
projectile.friendly = true;
|
||||
projectile.hostile = false;
|
||||
projectile.DamageType = DamageClass.Summon;
|
||||
projectile.damage = parentProj.damage;
|
||||
|
||||
base.OnSpawn(projectile, source);
|
||||
}
|
||||
|
||||
public override void OnHitNPC(Projectile projectile, NPC target, NPC.HitInfo hit, int damageDone) {
|
||||
Player player = Main.player[projectile.owner];
|
||||
YhtPlayer modPlayer = player.GetModPlayer<YhtPlayer>();
|
||||
|
||||
// Player's own minions
|
||||
if (projectile.minion && Main.myPlayer == projectile.owner) {
|
||||
if (modPlayer.SummonerAmbition) {
|
||||
HandleDeerclopsEffect(modPlayer, target, projectile);
|
||||
HandleQueenBeeEffect(modPlayer, target);
|
||||
HandlePerforatorsEffect(modPlayer, target, projectile);
|
||||
HandleHiveMindEffect(modPlayer, target, projectile);
|
||||
}
|
||||
}
|
||||
|
||||
// Whips
|
||||
if (modPlayer.SummonerAmbition && ProjectileID.Sets.IsAWhip[projectile.type]) {
|
||||
if (modPlayer.SummonerAmbitions.Contains("eye_of_cthulhu")) {
|
||||
projectile.damage = (int)(projectile.damage * 1.1);
|
||||
}
|
||||
|
||||
if (ModLoader.HasMod("CalamityMod")) {
|
||||
if (modPlayer.SummonerAmbitions.Contains("crabulon")) {
|
||||
target.AddBuff(ModContent.BuffType<ShroomGlowDebuff>(), 5 * 60);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
base.OnHitNPC(projectile, target, hit, damageDone);
|
||||
}
|
||||
|
||||
private static void HandleDeerclopsEffect(YhtPlayer modPlayer, NPC target, Projectile projectile) {
|
||||
Player player = modPlayer.Player;
|
||||
if (!modPlayer.SummonerAmbitions.Contains("deerclops")) return;
|
||||
if (modPlayer.SummonerAmbitionDeerclopsCooldown != 0) return;
|
||||
if (!Main.rand.NextBool(10)) return;
|
||||
|
||||
modPlayer.SummonerAmbitionDeerclopsCooldown = 5 * 60;
|
||||
Vector2 direction = new(Main.rand.NextFloat(-1f, 1f), Main.rand.NextFloat(-1f, 1f));
|
||||
direction.Normalize();
|
||||
direction *= Main.rand.NextFloat(4f, 8f);
|
||||
Projectile.NewProjectile(
|
||||
player.GetSource_OnHit(target),
|
||||
target.Center,
|
||||
direction,
|
||||
ProjectileID.InsanityShadowFriendly,
|
||||
(int) (projectile.damage * 0.5),
|
||||
0f,
|
||||
projectile.owner
|
||||
);
|
||||
}
|
||||
|
||||
private static void HandleQueenBeeEffect(YhtPlayer modPlayer, NPC target) {
|
||||
if (!modPlayer.SummonerAmbitions.Contains("queen_bee")) return;
|
||||
if (!Main.rand.NextBool(4)) return;
|
||||
target.AddBuff(BuffID.Poisoned, 5 * 60);
|
||||
}
|
||||
|
||||
private static void HandlePerforatorsEffect(YhtPlayer modPlayer, NPC target, Projectile projectile) {
|
||||
if (!ModLoader.HasMod("CalamityMod")) return;
|
||||
if (!modPlayer.SummonerAmbitions.Contains("perforators")) return;
|
||||
if (modPlayer.SummonerAmbitionPerforatorsCooldown != 0) return;
|
||||
if (!Main.rand.NextBool(10)) return;
|
||||
modPlayer.SummonerAmbitionPerforatorsCooldown = 20 * 60;
|
||||
Vector2 direction = new(Main.rand.NextFloat(-1f, 1f), Main.rand.NextFloat(-1f, 1f));
|
||||
direction.Normalize();
|
||||
direction *= Main.rand.NextFloat(4f, 5f);
|
||||
int projectileType = ModContent.ProjectileType<CalamityMod.Projectiles.Boss.IchorBlob>();
|
||||
int projectileId = Projectile.NewProjectile(
|
||||
modPlayer.Player.GetSource_OnHit(target),
|
||||
target.Center,
|
||||
direction,
|
||||
projectileType,
|
||||
(int) (projectile.damage * 0.75f),
|
||||
0f,
|
||||
projectile.owner
|
||||
);
|
||||
Projectile blob = Main.projectile[projectileId];
|
||||
blob.friendly = true;
|
||||
blob.hostile = false;
|
||||
blob.DamageType = DamageClass.Summon;
|
||||
}
|
||||
|
||||
private static void HandleHiveMindEffect(YhtPlayer modPlayer, NPC target, Projectile projectile) {
|
||||
if (!ModLoader.HasMod("CalamityMod")) return;
|
||||
if (!modPlayer.SummonerAmbitions.Contains("hive_mind")) return;
|
||||
if (modPlayer.SummonerAmbitionHiveMindCooldown != 0) return;
|
||||
if (!Main.rand.NextBool(10)) return;
|
||||
modPlayer.SummonerAmbitionHiveMindCooldown = 3 * 60;
|
||||
int projectileType = ModContent.ProjectileType<CalamityMod.Projectiles.Boss.ShadeNimbusHostile>();
|
||||
int projectileId = Projectile.NewProjectile(
|
||||
modPlayer.Player.GetSource_OnHit(target),
|
||||
target.Center,
|
||||
new Vector2(0, -0.25f),
|
||||
projectileType,
|
||||
(int) (projectile.damage * 0.75f),
|
||||
0f,
|
||||
projectile.owner
|
||||
);
|
||||
Projectile blob = Main.projectile[projectileId];
|
||||
blob.friendly = true;
|
||||
blob.hostile = false;
|
||||
blob.DamageType = DamageClass.Summon;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace YHTMod.Changes;
|
||||
|
||||
public class WarriorItemEffects : GlobalItem {
|
||||
|
||||
public override void UseItemHitbox(Item item, Player player, ref Rectangle hitbox, ref bool noHitbox) {
|
||||
YhtPlayer modPlayer = player.GetModPlayer<YhtPlayer>();
|
||||
|
||||
if (!modPlayer.WarriorAmbition) {
|
||||
base.UseItemHitbox(item, player, ref hitbox, ref noHitbox);
|
||||
return;
|
||||
}
|
||||
|
||||
if (item.DamageType == DamageClass.Melee && !item.noMelee) {
|
||||
float scale = modPlayer.GetWarriorsAmbitionMeleeSizeBonus();
|
||||
if (scale > 1f) {
|
||||
int newW = (int)(hitbox.Width * scale);
|
||||
int newH = (int)(hitbox.Height * scale);
|
||||
int cx = hitbox.X + hitbox.Width / 2;
|
||||
int cy = hitbox.Y + hitbox.Height / 2;
|
||||
hitbox.X = cx - newW / 2;
|
||||
hitbox.Y = cy - newH / 2;
|
||||
hitbox.Width = newW;
|
||||
hitbox.Height = newH;
|
||||
}
|
||||
}
|
||||
|
||||
base.UseItemHitbox(item, player, ref hitbox, ref noHitbox);
|
||||
}
|
||||
|
||||
public override void HoldItem(Item item, Player player) {
|
||||
YhtPlayer modPlayer = player.GetModPlayer<YhtPlayer>();
|
||||
|
||||
if (!modPlayer.WarriorAmbition) {
|
||||
base.HoldItem(item, player);
|
||||
return;
|
||||
}
|
||||
|
||||
if (item.DamageType == DamageClass.Melee && !item.noMelee) {
|
||||
float sizeBonus = modPlayer.GetWarriorsAmbitionMeleeSizeBonus();
|
||||
if (sizeBonus >= 1f)
|
||||
{
|
||||
item.scale *= sizeBonus;
|
||||
}
|
||||
}
|
||||
base.HoldItem(item, player);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
using Terraria;
|
||||
using Terraria.GameContent.Creative;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace YHTMod.Items.ArcaneMissile;
|
||||
|
||||
public class ArcaneMissile : ModItem {
|
||||
public override void SetStaticDefaults() {
|
||||
CreativeItemSacrificesCatalog.Instance.SacrificeCountNeededByItemId[Type] = 1;
|
||||
}
|
||||
|
||||
public override void SetDefaults() {
|
||||
Item.width = 32;
|
||||
Item.height = 32;
|
||||
Item.accessory = true;
|
||||
Item.damage = 10;
|
||||
Item.rare = ItemRarityID.LightRed;
|
||||
Item.DamageType = DamageClass.Magic;
|
||||
Item.noMelee = true;
|
||||
Item.noUseGraphic = true;
|
||||
}
|
||||
|
||||
public override void UpdateAccessory(Player player, bool hideVisual) {
|
||||
player.GetModPlayer<YhtPlayer>().ArcaneMissile = Item.damage;
|
||||
|
||||
base.UpdateAccessory(player, hideVisual);
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.6 KiB |
@@ -0,0 +1,45 @@
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace YHTMod.Items.ArcaneMissile;
|
||||
|
||||
public class ArcaneMissileBehavior : GlobalNPC {
|
||||
public override void OnHitByProjectile(NPC npc, Projectile projectile, NPC.HitInfo hitInfo, int damage) {
|
||||
if (!hitInfo.Crit) {
|
||||
base.OnHitByProjectile(npc, projectile, hitInfo, damage);
|
||||
return;
|
||||
}
|
||||
|
||||
if (Main.netMode == NetmodeID.Server) {
|
||||
return;
|
||||
}
|
||||
|
||||
Player player = Main.LocalPlayer;
|
||||
|
||||
if (player.GetModPlayer<YhtPlayer>().ArcaneMissile != 0 && projectile.DamageType == DamageClass.Magic) {
|
||||
// player just crit with magic weapon while having arcane missile accessory
|
||||
Projectile proj = Projectile.NewProjectileDirect(
|
||||
projectile.GetSource_FromThis("arcaneMissile"),
|
||||
Main.LocalPlayer.position,
|
||||
npc.position.DirectionFrom(Main.LocalPlayer.position),
|
||||
ProjectileID.MagicMissile,
|
||||
player.GetModPlayer<YhtPlayer>().ArcaneMissile,
|
||||
0,
|
||||
Main.LocalPlayer.whoAmI
|
||||
);
|
||||
proj.friendly = true;
|
||||
proj.hostile = false;
|
||||
proj.timeLeft = 300;
|
||||
proj.maxPenetrate = 1;
|
||||
proj.tileCollide = false;
|
||||
proj.DamageType = DamageClass.Magic;
|
||||
proj.aiStyle = ProjAIStyleID.MagicMissile;
|
||||
|
||||
// Prevent crits for the missiles
|
||||
proj.CritChance = int.MinValue;
|
||||
}
|
||||
|
||||
base.OnHitByProjectile(npc, projectile, hitInfo, damage);
|
||||
}
|
||||
}
|
||||
@@ -7,7 +7,6 @@ namespace YHTMod.Items;
|
||||
|
||||
public class CopperSwordOnAStick : ModItem {
|
||||
public override void SetStaticDefaults() {
|
||||
DisplayName.SetDefault("Copper Sword On A Stick");
|
||||
CreativeItemSacrificesCatalog.Instance.SacrificeCountNeededByItemId[Type] = 1;
|
||||
}
|
||||
|
||||
|
||||
+8
-9
@@ -7,23 +7,23 @@ using Terraria.ModLoader;
|
||||
namespace YHTMod.Items;
|
||||
|
||||
public class KatanaRedo : GlobalItem {
|
||||
|
||||
public override void ModifyTooltips(Item item, List<TooltipLine> tooltips)
|
||||
{
|
||||
public override void ModifyTooltips(Item item, List<TooltipLine> tooltips) {
|
||||
if (item.type != ItemID.Katana) return;
|
||||
tooltips.Insert(5, new TooltipLine(YHTMod.GetInstance(), "flavor", "Nothing personel kid."));
|
||||
tooltips.Insert(6, new TooltipLine(YHTMod.GetInstance(), "usage", "Right click to teleport behind them."));
|
||||
}
|
||||
|
||||
public override bool AltFunctionUse(Item item, Player player) {
|
||||
if (item.type != ItemID.Katana) {
|
||||
return base.AltFunctionUse(item, player);
|
||||
}
|
||||
return true;
|
||||
return item.type == ItemID.Katana || base.AltFunctionUse(item, player);
|
||||
}
|
||||
|
||||
public override bool? UseItem(Item item, Player player) {
|
||||
if (item.type != ItemID.Katana || player.altFunctionUse != 2) return null;
|
||||
YhtPlayer yhtPlayer = player.GetModPlayer<YhtPlayer>();
|
||||
|
||||
if (yhtPlayer.KatanaTeleportCooldown > 0) return null;
|
||||
yhtPlayer.KatanaTeleportCooldown = 300;
|
||||
|
||||
for (int i = 0; i < Main.maxNPCs; i++) {
|
||||
NPC npc = Main.npc[i];
|
||||
if (!npc.CanBeChasedBy()) continue;
|
||||
@@ -34,7 +34,7 @@ public class KatanaRedo : GlobalItem {
|
||||
bool lineOfSight = Collision.CanHitLine(player.position, player.width, player.height, npc.position,
|
||||
npc.width, npc.height);
|
||||
|
||||
if (inRange && lineOfSight) {
|
||||
if (!inRange || !lineOfSight) continue;
|
||||
Vector2 tpPos = npc.position;
|
||||
tpPos.X += -(npc.direction * npc.width + (player.width * 2));
|
||||
|
||||
@@ -45,7 +45,6 @@ public class KatanaRedo : GlobalItem {
|
||||
player.NinjaDodge();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -7,20 +7,6 @@ namespace YHTMod.Items;
|
||||
|
||||
public class MithrilPebbleOfPigSmiting : ModItem {
|
||||
public override void SetStaticDefaults() {
|
||||
DisplayName.SetDefault("Mithril Pebble of Pig Smiting");
|
||||
Tooltip.SetDefault(
|
||||
"For you see long ago this pebble was forged in the fiery pits of Tartarus. By the grand blacksmith of Lucifer himself. In a time before the world began there were\n" +
|
||||
"pigs that roamed the world of aincrad. They took what they pleased and did what they wanted. The humans tried to survive but the pigs were too powerful. Then a man stood against the hogs!\n" +
|
||||
"His name... Well its not a Him its a Her...HER name...was...Akane! Lucifer crafted this mighty weapon for Akane. Amd she threw it Over and Over, Again and Again. She freed\n" +
|
||||
"the humans but the pigs wouldn't give up! In a mighty battle Akane fell to the Hogs Hero, Becon! Like Bacon but with a 'E' instead of a 'A'. ANYWAY Becon used his Cleaver to strike\n" +
|
||||
"down Akane. And the pebble fell. One of the hogs tried to pick it up but that hog died as soon as he touched the stone. Another Hero picked up the pebble. It was Akanes Apprentice. Sophie.\n" +
|
||||
"The hogs ran from the battlefield as Sophie threw the pebble. Striking many of them down. But there were too many. After returning home Sophie trained hard and set off to find Becon.\n" +
|
||||
"She killed hog after hog looking for him. One little piggy spilled and told her when he was. She made Becon, Into Bacon. Battle after battle the Hogs Became weaker. With time so did Sophie.\n" +
|
||||
"She died because she ate too much Pork. And the Pebble was passed too Marjosa. He made a decision. Instead of killing them all. He made them walk on four legs. He would eat them and keep them\n" +
|
||||
"locked up where they cant escape. Some Hogs rebelled but most of them went with it. Accepting defeat. Then as Marjosa was Hunting wild Hogs. 3 appeared at once. Taking him by surprise.\n" +
|
||||
"They hit him with there sharp horns. Marjosa hit the with the Mighty Pebble killing them all but he was weak and far from anyone who could offer help. And Thus, Marjosa\n" +
|
||||
"Guardian of the Pebble fell to his knees and passed from this world. Leaving behind the mighty weapon. For he knew. One day its power would be required once more.\n" +
|
||||
"But the Legacy of the pebble lives on.");
|
||||
CreativeItemSacrificesCatalog.Instance.SacrificeCountNeededByItemId[Type] = 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,163 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Terraria;
|
||||
using Terraria.GameContent.Creative;
|
||||
using Terraria.ID;
|
||||
using Terraria.Localization;
|
||||
using Terraria.ModLoader;
|
||||
using YHTMod.Changes;
|
||||
|
||||
namespace YHTMod.Items;
|
||||
|
||||
public class SummonersAmbition : ModItem {
|
||||
public override void SetStaticDefaults() {
|
||||
CreativeItemSacrificesCatalog.Instance.SacrificeCountNeededByItemId[Type] = 1;
|
||||
}
|
||||
|
||||
public override LocalizedText Tooltip => Language.GetText("");
|
||||
|
||||
public override void SetDefaults() {
|
||||
Item.width = 32;
|
||||
Item.height = 32;
|
||||
Item.accessory = true;
|
||||
Item.rare = ItemRarityID.White;
|
||||
Item.noMelee = true;
|
||||
Item.noUseGraphic = true;
|
||||
ItemID.Sets.ShimmerTransformToItem[Type] = 0;
|
||||
}
|
||||
|
||||
public override bool CanAccessoryBeEquippedWith(Item equippedItem, Item incomingItem, Player player) {
|
||||
return !(YHTMod.GetAmbitionItems().Contains(incomingItem.type) && YHTMod.GetAmbitionItems().Contains(equippedItem.type));
|
||||
}
|
||||
|
||||
public override void UpdateAccessory(Player player, bool hideVisual) {
|
||||
YhtPlayer modPlayer = player.GetModPlayer<YhtPlayer>();
|
||||
modPlayer.SummonerAmbition = true;
|
||||
}
|
||||
|
||||
public override void ModifyTooltips(List<TooltipLine> tooltips) {
|
||||
YhtPlayer player = Main.LocalPlayer.GetModPlayer<YhtPlayer>();
|
||||
|
||||
tooltips.Add(new TooltipLine(Mod, "SummonerAmbition",
|
||||
Language.GetTextValue("Mods.YHTMod.Items.SummonersAmbition.Tooltip",
|
||||
player.GetSummonersAmbitionMinionBonus())));
|
||||
|
||||
if (player.SummonerAmbitions.Contains("king_slime")) {
|
||||
int bonus = 20;
|
||||
if (ModLoader.HasMod("CalamityMod")) {
|
||||
bonus = 10;
|
||||
}
|
||||
tooltips.Add(new TooltipLine(Mod, "SummonerAmbitionKingSlime",
|
||||
Language.GetTextValue("Mods.YHTMod.Items.SummonersAmbition.KingSlime", bonus)));
|
||||
}
|
||||
|
||||
if (ModLoader.HasMod("CalamityMod") && player.SummonerAmbitions.Contains("desert_scourge")) {
|
||||
int id = CalamityHelper.GetBossIconId("desert_scourge");
|
||||
tooltips.Add(new TooltipLine(Mod, "SummonerAmbitionDesertScourge",
|
||||
Language.GetTextValue("Mods.YHTMod.Items.SummonersAmbition.DesertScourge", "[i:" + id + "]")));
|
||||
}
|
||||
|
||||
if (player.SummonerAmbitions.Contains("eye_of_cthulhu")) {
|
||||
tooltips.Add(new TooltipLine(Mod, "SummonerAmbitionEyeOfCthulhu",
|
||||
Language.GetTextValue("Mods.YHTMod.Items.SummonersAmbition.EyeOfCthulhu")));
|
||||
}
|
||||
|
||||
if (ModLoader.HasMod("CalamityMod") && player.SummonerAmbitions.Contains("crabulon")) {
|
||||
int id = CalamityHelper.GetBossIconId("crabulon");
|
||||
tooltips.Add(new TooltipLine(Mod, "SummonerAmbitionCrabulon",
|
||||
Language.GetTextValue("Mods.YHTMod.Items.SummonersAmbition.Crabulon", "[i:" + id + "]")));
|
||||
}
|
||||
|
||||
if (player.SummonerAmbitions.Contains("deerclops")) {
|
||||
tooltips.Add(new TooltipLine(Mod, "SummonerAmbitionDeerclops",
|
||||
Language.GetTextValue("Mods.YHTMod.Items.SummonersAmbition.Deerclops")));
|
||||
}
|
||||
|
||||
if (player.SummonerAmbitions.Contains("eater_of_worlds")) {
|
||||
tooltips.Add(new TooltipLine(Mod, "SummonerAmbitionEaterOfWorlds",
|
||||
Language.GetTextValue("Mods.YHTMod.Items.SummonersAmbition.EaterOfWorlds")));
|
||||
}
|
||||
|
||||
if (player.SummonerAmbitions.Contains("brain_of_cthulhu")) {
|
||||
tooltips.Add(new TooltipLine(Mod, "SummonerAmbitionBrainOfCthulhu",
|
||||
Language.GetTextValue("Mods.YHTMod.Items.SummonersAmbition.BrainOfCthulhu")));
|
||||
}
|
||||
|
||||
if (ModLoader.HasMod("CalamityMod") && player.SummonerAmbitions.Contains("perforators")) {
|
||||
int id = CalamityHelper.GetBossIconId("perforators");
|
||||
tooltips.Add(new TooltipLine(Mod, "SummonerAmbitionPerforators",
|
||||
Language.GetTextValue("Mods.YHTMod.Items.SummonersAmbition.Perforators", "[i:" + id + "]")));
|
||||
}
|
||||
|
||||
if (ModLoader.HasMod("CalamityMod") && player.SummonerAmbitions.Contains("hive_mind")) {
|
||||
int id = CalamityHelper.GetBossIconId("hive_mind");
|
||||
tooltips.Add(new TooltipLine(Mod, "SummonerAmbitionHiveMind",
|
||||
Language.GetTextValue("Mods.YHTMod.Items.SummonersAmbition.HiveMind", "[i:" + id + "]")));
|
||||
}
|
||||
|
||||
if (player.SummonerAmbitions.Contains("queen_bee")) {
|
||||
tooltips.Add(new TooltipLine(Mod, "SummonerAmbitionQueenBee",
|
||||
Language.GetTextValue("Mods.YHTMod.Items.SummonersAmbition.QueenBee")));
|
||||
}
|
||||
|
||||
if (player.SummonerAmbitions.Contains("skeletron")) {
|
||||
tooltips.Add(new TooltipLine(Mod, "SummonerAmbitionSkeletron",
|
||||
Language.GetTextValue("Mods.YHTMod.Items.SummonersAmbition.Skeletron")));
|
||||
}
|
||||
|
||||
if (ModLoader.HasMod("CalamityMod") && player.SummonerAmbitions.Contains("slime_god")) {
|
||||
int id = CalamityHelper.GetBossIconId("slime_god");
|
||||
tooltips.Add(new TooltipLine(Mod, "SummonerAmbitionSlimeGod",
|
||||
Language.GetTextValue("Mods.YHTMod.Items.SummonersAmbition.SlimeGod", "[i:" + id + "]")));
|
||||
}
|
||||
|
||||
if (player.SummonerAmbitions.Contains("wall_of_flesh")) {
|
||||
tooltips.Add(new TooltipLine(Mod, "SummonerAmbitionWallOfFlesh",
|
||||
Language.GetTextValue("Mods.YHTMod.Items.SummonersAmbition.WallOfFlesh")));
|
||||
}
|
||||
|
||||
if (IsPreHardmodeRealized(player.Player)) {
|
||||
tooltips.Add(new TooltipLine(Mod, "SummonerAmbitionPreHardmodeRealized",
|
||||
Language.GetTextValue("Mods.YHTMod.Items.SummonersAmbition.PreHardmodeRealized")));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public override void AddRecipes() {
|
||||
CreateRecipe()
|
||||
.AddIngredient(ItemID.Rope, 5)
|
||||
.AddRecipeGroup(RecipeGroupID.Squirrels)
|
||||
.AddIngredient(ItemID.Acorn, 25)
|
||||
.AddTile(TileID.WorkBenches)
|
||||
.Register();
|
||||
}
|
||||
|
||||
private static bool IsPreHardmodeRealized(Player player) {
|
||||
YhtPlayer modPlayer = player.GetModPlayer<YhtPlayer>();
|
||||
|
||||
HashSet<string> bossesToCheck = [
|
||||
"king_slime",
|
||||
"eye_of_cthulhu",
|
||||
"deerclops",
|
||||
"queen_bee",
|
||||
"skeletron",
|
||||
"wall_of_flesh"
|
||||
];
|
||||
|
||||
if (!modPlayer.SummonerAmbitions.Contains("eater_of_worlds") && !modPlayer.SummonerAmbitions.Contains("brain_of_cthulhu")) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (ModLoader.HasMod("CalamityMod")) {
|
||||
bossesToCheck.Add("desert_scourge");
|
||||
bossesToCheck.Add("crabulon");
|
||||
bossesToCheck.Add("slime_god");
|
||||
|
||||
if (!modPlayer.SummonerAmbitions.Contains("perforators") && !modPlayer.SummonerAmbitions.Contains("hive_mind")) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return bossesToCheck.All(boss => modPlayer.SummonerAmbitions.Contains(boss));
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 693 B |
+38
-41
@@ -3,6 +3,7 @@ using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.GameContent.Creative;
|
||||
using Terraria.ID;
|
||||
using Terraria.Localization;
|
||||
using Terraria.ModLoader;
|
||||
using YHTMod.Buffs;
|
||||
using YHTMod.Projectiles.Weapons;
|
||||
@@ -10,11 +11,9 @@ using YHTMod.Projectiles.Weapons;
|
||||
namespace YHTMod.Items;
|
||||
|
||||
public class ToclafaneStaff : ModItem {
|
||||
|
||||
public override void SetStaticDefaults() {
|
||||
DisplayName.SetDefault("Toclafane Staff");
|
||||
Tooltip.SetDefault("Summons a toclafane to remove population for you");
|
||||
ItemID.Sets.GamepadWholeScreenUseRange[Item.type] = true; // This lets the player target anywhere on the whole screen while using a controller.
|
||||
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;
|
||||
}
|
||||
@@ -37,48 +36,46 @@ 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() {
|
||||
CreateRecipe()
|
||||
.AddIngredient(ItemID.GuideVoodooDoll, 1)
|
||||
.AddIngredient(ItemID.HallowedBar, 15)
|
||||
.AddIngredient(ItemID.CopperWatch)
|
||||
.AddTile(TileID.MythrilAnvil)
|
||||
.Register();
|
||||
CreateRecipe()
|
||||
.AddIngredient(ItemID.GuideVoodooDoll, 1)
|
||||
.AddIngredient(ItemID.HallowedBar, 15)
|
||||
.AddIngredient(ItemID.TinWatch)
|
||||
.AddTile(TileID.MythrilAnvil)
|
||||
.Register();
|
||||
CreateRecipe()
|
||||
.AddIngredient(ItemID.GuideVoodooDoll, 1)
|
||||
.AddIngredient(ItemID.HallowedBar, 15)
|
||||
.AddIngredient(ItemID.SilverWatch)
|
||||
.AddTile(TileID.MythrilAnvil)
|
||||
.Register();
|
||||
CreateRecipe()
|
||||
.AddIngredient(ItemID.GuideVoodooDoll, 1)
|
||||
.AddIngredient(ItemID.HallowedBar, 15)
|
||||
.AddIngredient(ItemID.TungstenWatch)
|
||||
.AddTile(TileID.MythrilAnvil)
|
||||
.Register();
|
||||
CreateRecipe()
|
||||
.AddIngredient(ItemID.GuideVoodooDoll, 1)
|
||||
.AddIngredient(ItemID.HallowedBar, 15)
|
||||
.AddTile(TileID.MythrilAnvil)
|
||||
.AddIngredient(ItemID.GoldWatch)
|
||||
.Register();
|
||||
CreateRecipe()
|
||||
.AddIngredient(ItemID.GuideVoodooDoll, 1)
|
||||
.AddIngredient(ItemID.HallowedBar, 15)
|
||||
.AddIngredient(ItemID.PlatinumWatch)
|
||||
.AddTile(TileID.MythrilAnvil)
|
||||
.Register();
|
||||
RecipeGroup watchGroup = new RecipeGroup(() => Language.GetTextValue("Mods.YHTMod.Recipes.AnyWatch"),
|
||||
ItemID.GoldWatch,
|
||||
ItemID.SilverWatch,
|
||||
ItemID.TinWatch,
|
||||
ItemID.CopperWatch,
|
||||
ItemID.PlatinumWatch,
|
||||
ItemID.TungstenWatch
|
||||
);
|
||||
RecipeGroup.RegisterGroup("YHTMod:Watches", watchGroup);
|
||||
|
||||
RecipeGroup tier2BarGroup = new RecipeGroup(() => Language.GetTextValue("Mods.YHTMod.Recipes.Tier2Bars"),
|
||||
ItemID.MythrilBar,
|
||||
ItemID.OrichalcumBar
|
||||
);
|
||||
RecipeGroup.RegisterGroup("YHTMod:Tier2Bars", tier2BarGroup);
|
||||
|
||||
Recipe recipe = CreateRecipe();
|
||||
|
||||
recipe.AddRecipeGroup(watchGroup);
|
||||
recipe.AddIngredient(ItemID.GuideVoodooDoll);
|
||||
recipe.AddTile(TileID.MythrilAnvil);
|
||||
|
||||
// Calamity delays when you obtain hallowed bars, so use alternate recipe if Calamity is installed
|
||||
if (ModLoader.HasMod("CalamityMod")) {
|
||||
recipe.AddRecipeGroup(tier2BarGroup, 35);
|
||||
recipe.AddIngredient(ItemID.SoulofLight, 10);
|
||||
recipe.AddIngredient(ItemID.SoulofNight, 10);
|
||||
}
|
||||
else {
|
||||
recipe.AddIngredient(ItemID.HallowedBar, 15);
|
||||
}
|
||||
|
||||
recipe.Register();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,150 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Terraria;
|
||||
using Terraria.GameContent.Creative;
|
||||
using Terraria.ID;
|
||||
using Terraria.Localization;
|
||||
using Terraria.ModLoader;
|
||||
using YHTMod.Changes;
|
||||
|
||||
namespace YHTMod.Items;
|
||||
|
||||
public class WarriorsAmbition : ModItem {
|
||||
public override void SetStaticDefaults() {
|
||||
CreativeItemSacrificesCatalog.Instance.SacrificeCountNeededByItemId[Type] = 1;
|
||||
}
|
||||
|
||||
public override LocalizedText Tooltip => Language.GetText("");
|
||||
|
||||
public override void SetDefaults() {
|
||||
Item.width = 32;
|
||||
Item.height = 32;
|
||||
Item.accessory = true;
|
||||
Item.rare = ItemRarityID.White;
|
||||
Item.noMelee = true;
|
||||
Item.noUseGraphic = true;
|
||||
ItemID.Sets.ShimmerTransformToItem[Type] = 0;
|
||||
}
|
||||
|
||||
public override bool CanAccessoryBeEquippedWith(Item equippedItem, Item incomingItem, Player player) {
|
||||
return !(YHTMod.GetAmbitionItems().Contains(incomingItem.type) && YHTMod.GetAmbitionItems().Contains(equippedItem.type));
|
||||
}
|
||||
|
||||
public override void UpdateAccessory(Player player, bool hideVisual) {
|
||||
YhtPlayer modPlayer = player.GetModPlayer<YhtPlayer>();
|
||||
modPlayer.WarriorAmbition = true;
|
||||
}
|
||||
|
||||
public override void ModifyTooltips(List<TooltipLine> tooltips) {
|
||||
YhtPlayer player = Main.LocalPlayer.GetModPlayer<YhtPlayer>();
|
||||
tooltips.Add(new TooltipLine(Mod, "WarriorsAmbition",
|
||||
Language.GetTextValue("Mods.YHTMod.Items.WarriorAmbition.Tooltip")));
|
||||
|
||||
if (player.WarriorAmbitions.Contains("king_slime")) {
|
||||
float bonus = 5f;
|
||||
if (ModLoader.HasMod("CalamityMod")) {
|
||||
bonus = 2.5f;
|
||||
}
|
||||
tooltips.Add(new TooltipLine(Mod, "WarriorAmbitionKingSlime",
|
||||
Language.GetTextValue("Mods.YHTMod.Items.WarriorsAmbition.KingSlime", bonus)));
|
||||
}
|
||||
|
||||
if (ModLoader.HasMod("CalamityMod") && player.WarriorAmbitions.Contains("desert_scourge")) {
|
||||
int id = CalamityHelper.GetBossIconId("desert_scourge");
|
||||
tooltips.Add(new TooltipLine(Mod, "WarriorAmbitionDesertScourge",
|
||||
Language.GetTextValue("Mods.YHTMod.Items.WarriorsAmbition.DesertScourge", "[i:" + id + "]")));
|
||||
}
|
||||
|
||||
if (player.WarriorAmbitions.Contains("eye_of_cthulhu")) {
|
||||
tooltips.Add(new TooltipLine(Mod, "WarriorAmbitionEyeOfCthulhu",
|
||||
Language.GetTextValue("Mods.YHTMod.Items.WarriorsAmbition.EyeOfCthulhu")));
|
||||
}
|
||||
|
||||
if (ModLoader.HasMod("CalamityMod") && player.WarriorAmbitions.Contains("crabulon")) {
|
||||
int id = CalamityHelper.GetBossIconId("crabulon");
|
||||
tooltips.Add(new TooltipLine(Mod, "WarriorAmbitionCrabulon",
|
||||
Language.GetTextValue("Mods.YHTMod.Items.WarriorsAmbition.Crabulon", "[i:" + id + "]")));
|
||||
}
|
||||
|
||||
if (player.WarriorAmbitions.Contains("deerclops")) {
|
||||
tooltips.Add(new TooltipLine(Mod, "WarriorAmbitionDeerclops",
|
||||
Language.GetTextValue("Mods.YHTMod.Items.WarriorsAmbition.Deerclops")));
|
||||
}
|
||||
|
||||
if (player.WarriorAmbitions.Contains("eater_of_worlds")) {
|
||||
tooltips.Add(new TooltipLine(Mod, "WarriorAmbitionEaterOfWorlds",
|
||||
Language.GetTextValue("Mods.YHTMod.Items.WarriorsAmbition.EaterOfWorlds")));
|
||||
}
|
||||
|
||||
if (player.WarriorAmbitions.Contains("brain_of_cthulhu")) {
|
||||
tooltips.Add(new TooltipLine(Mod, "WarriorAmbitionBrainOfCthulhu",
|
||||
Language.GetTextValue("Mods.YHTMod.Items.WarriorsAmbition.BrainOfCthulhu")));
|
||||
}
|
||||
|
||||
if (ModLoader.HasMod("CalamityMod") && player.WarriorAmbitions.Contains("perforators")) {
|
||||
int id = CalamityHelper.GetBossIconId("perforators");
|
||||
tooltips.Add(new TooltipLine(Mod, "WarriorAmbitionPerforators",
|
||||
Language.GetTextValue("Mods.YHTMod.Items.WarriorsAmbition.Perforators", "[i:" + id + "]")));
|
||||
}
|
||||
|
||||
if (ModLoader.HasMod("CalamityMod") && player.WarriorAmbitions.Contains("hive_mind")) {
|
||||
int id = CalamityHelper.GetBossIconId("hive_mind");
|
||||
tooltips.Add(new TooltipLine(Mod, "WarriorAmbitionHiveMind",
|
||||
Language.GetTextValue("Mods.YHTMod.Items.WarriorsAmbition.HiveMind", "[i:" + id + "]")));
|
||||
}
|
||||
|
||||
if (player.WarriorAmbitions.Contains("queen_bee")) {
|
||||
tooltips.Add(new TooltipLine(Mod, "WarriorAmbitionQueenBee",
|
||||
Language.GetTextValue("Mods.YHTMod.Items.WarriorsAmbition.QueenBee")));
|
||||
}
|
||||
|
||||
if (player.WarriorAmbitions.Contains("skeletron")) {
|
||||
tooltips.Add(new TooltipLine(Mod, "WarriorAmbitionSkeletron",
|
||||
Language.GetTextValue("Mods.YHTMod.Items.WarriorsAmbition.Skeletron")));
|
||||
}
|
||||
|
||||
if (player.WarriorAmbitions.Contains("wall_of_flesh")) {
|
||||
tooltips.Add(new TooltipLine(Mod, "WarriorAmbitionWallOfFlesh",
|
||||
Language.GetTextValue("Mods.YHTMod.Items.WarriorsAmbition.WallOfFlesh")));
|
||||
}
|
||||
|
||||
if (ModLoader.HasMod("CalamityMod") && player.WarriorAmbitions.Contains("slime_god")) {
|
||||
int id = CalamityHelper.GetBossIconId("slime_god");
|
||||
tooltips.Add(new TooltipLine(Mod, "WarriorAmbitionSlimeGod",
|
||||
Language.GetTextValue("Mods.YHTMod.Items.WarriorsAmbition.SlimeGod", "[i:" + id + "]")));
|
||||
}
|
||||
}
|
||||
|
||||
public override void AddRecipes() {
|
||||
|
||||
}
|
||||
|
||||
private static bool IsPreHardmodeRealized(Player player) {
|
||||
YhtPlayer modPlayer = player.GetModPlayer<YhtPlayer>();
|
||||
|
||||
HashSet<string> bossesToCheck = [
|
||||
"king_slime",
|
||||
"eye_of_cthulhu",
|
||||
"deerclops",
|
||||
"queen_bee",
|
||||
"skeletron",
|
||||
"wall_of_flesh"
|
||||
];
|
||||
|
||||
if (!modPlayer.WarriorAmbitions.Contains("eater_of_worlds") && !modPlayer.WarriorAmbitions.Contains("brain_of_cthulhu")) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (ModLoader.HasMod("CalamityMod")) {
|
||||
bossesToCheck.Add("desert_scourge");
|
||||
bossesToCheck.Add("crabulon");
|
||||
bossesToCheck.Add("slime_god");
|
||||
|
||||
if (!modPlayer.WarriorAmbitions.Contains("perforators") && !modPlayer.WarriorAmbitions.Contains("hive_mind")) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return bossesToCheck.All(boss => modPlayer.WarriorAmbitions.Contains(boss));
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 621 B |
@@ -0,0 +1,140 @@
|
||||
Recipes: {
|
||||
AnyWatch: Any Watch
|
||||
Tier2Bars: Tier 2 Hardmode Bars
|
||||
}
|
||||
|
||||
Buffs: {
|
||||
ToclafaneMinionBuff: {
|
||||
DisplayName: Summon Toclafane
|
||||
Description: It came from a parallel world to fight for its Master
|
||||
}
|
||||
|
||||
SummonerAmbitionBuff: {
|
||||
DisplayName: Summoner's Ambition
|
||||
Description:
|
||||
'''
|
||||
Your power grows with your ambition
|
||||
|
||||
Essences absorbed: {0}
|
||||
'''
|
||||
}
|
||||
|
||||
ShroomGlowDebuff: {
|
||||
DisplayName: Shroom Glow
|
||||
Description:
|
||||
'''
|
||||
You are emitting a faint glow...
|
||||
And smell like mushrooms.
|
||||
'''
|
||||
}
|
||||
|
||||
WarriorAmbitionBuff: {
|
||||
DisplayName: Warrior's Ambition
|
||||
Description:
|
||||
'''
|
||||
Your power grows with your ambition
|
||||
|
||||
Essences absorbed: {0}
|
||||
'''
|
||||
}
|
||||
}
|
||||
|
||||
Items: {
|
||||
ArcaneMissile: {
|
||||
DisplayName: Arcane Missile
|
||||
Tooltip:
|
||||
'''
|
||||
Magical projectile crits shoot a homing arcane missile
|
||||
Arcane missiles cannot crit
|
||||
'''
|
||||
}
|
||||
|
||||
CopperSwordOnAStick: {
|
||||
DisplayName: Copper Sword On A Stick
|
||||
Tooltip: ""
|
||||
}
|
||||
|
||||
MithrilPebbleOfPigSmiting: {
|
||||
DisplayName: Mithril Pebble Of Pig Smiting
|
||||
Tooltip:
|
||||
'''
|
||||
For you see long ago this pebble was forged in the fiery pits of Tartarus. By the grand blacksmith of Lucifer himself.
|
||||
In a time before the world began there were pigs that roamed the world of Aincrad. They took what they pleased and did
|
||||
what they wanted. The humans tried to survive but the pigs were too powerful. Then a man stood against the hogs! His
|
||||
name... Well its not a Him its a Her...HER name...was...Akane! Lucifer crafted this mighty weapon for Akane. And she
|
||||
threw it Over and Over, Again and Again. She freed the humans but the pigs wouldn't give up! In a mighty battle Akane
|
||||
fell to the Hogs Hero, Becon! Like Bacon but with a 'E' instead of a 'A'. ANYWAY Becon used his Cleaver to strike down
|
||||
Akane. And the pebble fell. One of the hogs tried to pick it up but that hog died as soon as he touched the stone.
|
||||
Another Hero picked up the pebble. It was Akane's Apprentice. Sophie. The hogs ran from the battlefield as Sophie threw
|
||||
the pebble. Striking many of them down. But there were too many. After returning home Sophie trained hard and set off
|
||||
to find Becon. She killed hog after hog looking for him. One little piggy spilled and told her when he was. She made
|
||||
Becon, Into Bacon. Battle after battle the Hogs Became weaker. With time so did Sophie. She died because she ate too
|
||||
much Pork. And the Pebble was passed too Marjosa. He made a decision. Instead of killing them all. He made them walk
|
||||
on four legs. He would eat them and keep them locked up where they cant escape. Some Hogs rebelled but most of them
|
||||
went with it. Accepting defeat. Then as Marjosa was Hunting wild Hogs. 3 appeared at once. Taking him by surprise.
|
||||
They hit him with there sharp horns. Marjosa hit the with the Mighty Pebble killing them all but he was weak and far
|
||||
from anyone who could offer help. And Thus, Marjosa Guardian of the Pebble fell to his knees and passed from this
|
||||
world. Leaving behind the mighty weapon. For he knew. One day its power would be required once more.
|
||||
But the Legacy of the pebble lives on.
|
||||
'''
|
||||
}
|
||||
|
||||
ToclafaneStaff: {
|
||||
DisplayName: Toclafane Staff
|
||||
Tooltip: Summons a toclafane to remove population for you
|
||||
}
|
||||
|
||||
SummonersAmbition: {
|
||||
DisplayName: Summoner's Ambition
|
||||
Tooltip:
|
||||
'''
|
||||
Grants Summoner's Ambition.
|
||||
"For those who seek to lead."
|
||||
{$CommonItemTooltip.IncreasesMaxMinionsBy@0}
|
||||
'''
|
||||
KingSlime: "[i:560] {0}% increased whip size"
|
||||
DesertScourge: "{0} Increases maximum life by 5"
|
||||
EyeOfCthulhu: "[i:43] Increases whip damage by 10%"
|
||||
Crabulon: "{0} Enemies struck by whips glow slightly"
|
||||
EaterOfWorlds: "[i:70] Summon damage penetrates 5 armor"
|
||||
BrainOfCthulhu: "[i:1331] 5% increased minion damage"
|
||||
HiveMind: "{0} Occasionally spawns Shade Nimbus to rain on enemies"
|
||||
Perforators: "{0} Occasionally spawns ichor blobs on minion hits"
|
||||
QueenBee: "[i:1133] Minion hits can inflict poison"
|
||||
Deerclops: "[i:5120] Minion hits can spawn shadow hands"
|
||||
Skeletron: "[i:4801] Increases minion knockback"
|
||||
WallOfFlesh: "[i:267] Increases max number of minions by 1"
|
||||
SlimeGod: "{0} 10% increased whip size"
|
||||
PreHardmodeRealized: Fully realized. Seek greater heights.
|
||||
}
|
||||
|
||||
WarriorsAmbition: {
|
||||
DisplayName: Warriors Ambition
|
||||
Tooltip:
|
||||
'''
|
||||
Grants Warrior's Ambition.
|
||||
"For those who wish to face enemy head on."
|
||||
{0} defense
|
||||
'''
|
||||
KingSlime: "[i:560] {0}% increased true melee weapon size"
|
||||
DesertScourge: "{0} Increases maximum life by 10"
|
||||
EyeOfCthulhu: "[i:43] Increases melee damage by 10%"
|
||||
Crabulon: "{0} Enemies struck by whips glow slightly"
|
||||
EaterOfWorlds: "[i:70] Melee damage penetrates 5 armor"
|
||||
BrainOfCthulhu: "[i:1331] 5% increased true melee damage"
|
||||
HiveMind: "{0} +2 defense"
|
||||
Perforators: "{0} +2 defense"
|
||||
QueenBee: "[i:1133] Damaging debuffs expire 5% faster on you"
|
||||
Deerclops: "[i:5120] Melee hits can throw debris"
|
||||
Skeletron: "[i:4801] Increases melee knockback"
|
||||
WallOfFlesh: "[i:267] +5 defense"
|
||||
SlimeGod: "{0} 2.5% increased true melee weapon size"
|
||||
PreHardmodeRealized: Fully realized. Seek greater heights.
|
||||
}
|
||||
}
|
||||
|
||||
Projectiles: {
|
||||
CopperSwordOnAStickProjectile.DisplayName: Copper Sword On A Stick
|
||||
MithrilPebbleOfPigSmitingProjectile.DisplayName: Mithril Pebble Of Pig Smiting
|
||||
ToclafaneMinion.DisplayName: Toclafane Minion
|
||||
}
|
||||
@@ -24,7 +24,8 @@ class CopperSwordOnAStickProjectile : ModProjectile {
|
||||
public override void AI() {
|
||||
base.AI();
|
||||
float random = (float)(Random.Shared.NextDouble() / 5f);
|
||||
Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2 - MathHelper.PiOver4 * Projectile.spriteDirection;
|
||||
Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2 -
|
||||
MathHelper.PiOver4 * Projectile.spriteDirection;
|
||||
Projectile.rotation += random;
|
||||
DrawOriginOffsetX = 0;
|
||||
DrawOffsetX = 0;
|
||||
|
||||
@@ -8,12 +8,10 @@ using YHTMod.Buffs;
|
||||
namespace YHTMod.Projectiles.Weapons;
|
||||
|
||||
public class ToclafaneMinion : ModProjectile {
|
||||
|
||||
private int shootCooldown = 0;
|
||||
private AttackMode attackMode = AttackMode.RANGED;
|
||||
private int _shootCooldown = 0;
|
||||
private AttackMode _attackMode = AttackMode.Ranged;
|
||||
|
||||
public override void SetStaticDefaults() {
|
||||
DisplayName.SetDefault("Toclafane Minion");
|
||||
// Sets the amount of frames this minion has on its spritesheet
|
||||
Main.projFrames[Projectile.type] = 8;
|
||||
// This is necessary for right-click targeting
|
||||
@@ -61,11 +59,11 @@ public class ToclafaneMinion : ModProjectile {
|
||||
|
||||
#region General behavior
|
||||
|
||||
if (shootCooldown > 0) {
|
||||
shootCooldown = shootCooldown - 1;
|
||||
if (_shootCooldown > 0) {
|
||||
_shootCooldown = _shootCooldown - 1;
|
||||
}
|
||||
|
||||
attackMode = AttackMode.RANGED;
|
||||
_attackMode = AttackMode.Ranged;
|
||||
|
||||
Vector2 idlePosition = player.Center;
|
||||
idlePosition.Y -= 48f;
|
||||
@@ -87,19 +85,18 @@ public class ToclafaneMinion : ModProjectile {
|
||||
}
|
||||
|
||||
// If your minion is flying, you want to do this independently of any conditions
|
||||
float overlapVelocity = 0.04f;
|
||||
const float overlapVelocity = 0.04f;
|
||||
for (int i = 0; i < Main.maxProjectiles; i++) {
|
||||
// Fix overlap with other minions
|
||||
Projectile other = Main.projectile[i];
|
||||
if (i != Projectile.whoAmI && other.active && other.owner == Projectile.owner &&
|
||||
Math.Abs(Projectile.position.X - other.position.X) +
|
||||
Math.Abs(Projectile.position.Y - other.position.Y) < Projectile.width) {
|
||||
if (i == Projectile.whoAmI || !other.active || other.owner != Projectile.owner ||
|
||||
!(Math.Abs(Projectile.position.X - other.position.X) +
|
||||
Math.Abs(Projectile.position.Y - other.position.Y) < Projectile.width)) continue;
|
||||
if (Projectile.position.X < other.position.X) Projectile.velocity.X -= overlapVelocity;
|
||||
else Projectile.velocity.X += overlapVelocity;
|
||||
if (Projectile.position.Y < other.position.Y) Projectile.velocity.Y -= overlapVelocity;
|
||||
else Projectile.velocity.Y += overlapVelocity;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -125,23 +122,21 @@ public class ToclafaneMinion : ModProjectile {
|
||||
if (!foundTarget) {
|
||||
for (int i = 0; i < Main.maxNPCs; i++) {
|
||||
NPC npc = Main.npc[i];
|
||||
if (npc.CanBeChasedBy()) {
|
||||
if (!npc.CanBeChasedBy()) continue;
|
||||
float between = Vector2.Distance(npc.Center, Projectile.Center);
|
||||
bool closest = Vector2.Distance(Projectile.Center, targetCenter) > between;
|
||||
bool inRange = between < distanceFromTarget;
|
||||
bool lineOfSight = Collision.CanHitLine(Projectile.position, Projectile.width,
|
||||
Projectile.height, npc.position, npc.width, npc.height);
|
||||
// Additional check for this specific minion behavior, otherwise it will stop attacking once it dashed through an enemy while flying though tiles afterwards
|
||||
// Additional check for this specific minion behavior, otherwise it will stop attacking once it dashed through an enemy while flying though tiles afterward
|
||||
// The number depends on various parameters seen in the movement code below. Test different ones out until it works alright
|
||||
bool closeThroughWall = between < 100f;
|
||||
if (((closest && inRange) || !foundTarget) && (lineOfSight || closeThroughWall)) {
|
||||
if (((!closest || !inRange) && foundTarget) || (!lineOfSight && !closeThroughWall)) continue;
|
||||
distanceFromTarget = between;
|
||||
targetCenter = npc.Center;
|
||||
foundTarget = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Projectile.friendly = foundTarget;
|
||||
|
||||
@@ -162,18 +157,20 @@ public class ToclafaneMinion : ModProjectile {
|
||||
Projectile.velocity = (Projectile.velocity * (inertia - 1) + direction) / inertia;
|
||||
}
|
||||
|
||||
if (distanceFromTarget <= 120f) {
|
||||
attackMode = AttackMode.MELEE;
|
||||
}
|
||||
|
||||
if (distanceFromTarget > 120f && shootCooldown == 0) {
|
||||
shootCooldown = 60; // 1 second between shots
|
||||
switch (distanceFromTarget) {
|
||||
case <= 120f:
|
||||
_attackMode = AttackMode.Melee;
|
||||
break;
|
||||
case > 120f when _shootCooldown == 0: {
|
||||
_shootCooldown = 60; // 1 second between shots
|
||||
Projectile laser = Projectile.NewProjectileDirect(player.GetSource_FromThis(), Projectile.Center,
|
||||
direction, ProjectileID.DeathLaser, 30, Projectile.knockBack, Projectile.owner);
|
||||
laser.friendly = true;
|
||||
laser.hostile = false;
|
||||
laser.penetrate = 5;
|
||||
attackMode = AttackMode.RANGED;
|
||||
_attackMode = AttackMode.Ranged;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
@@ -211,18 +208,15 @@ public class ToclafaneMinion : ModProjectile {
|
||||
// So it will lean slightly towards the direction it's moving
|
||||
Projectile.rotation = Projectile.velocity.X * 0.05f;
|
||||
|
||||
int frameSpeed = 8;
|
||||
const int frameSpeed = 8;
|
||||
Projectile.frameCounter++;
|
||||
if (Projectile.frameCounter >= frameSpeed) {
|
||||
Projectile.frameCounter = 0;
|
||||
if (attackMode == AttackMode.MELEE) {
|
||||
switch (_attackMode) {
|
||||
case AttackMode.Melee:
|
||||
switch (Projectile.frame) {
|
||||
case 0:
|
||||
Projectile.frame++;
|
||||
break;
|
||||
case 1:
|
||||
Projectile.frame++;
|
||||
break;
|
||||
case 2:
|
||||
Projectile.frame++;
|
||||
break;
|
||||
@@ -242,9 +236,9 @@ public class ToclafaneMinion : ModProjectile {
|
||||
Projectile.frame = 4;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (attackMode == AttackMode.RANGED) {
|
||||
break;
|
||||
case AttackMode.Ranged:
|
||||
switch (Projectile.frame) {
|
||||
case 0:
|
||||
Projectile.frame = 5;
|
||||
@@ -259,11 +253,7 @@ public class ToclafaneMinion : ModProjectile {
|
||||
Projectile.frame = 4;
|
||||
break;
|
||||
case 4:
|
||||
Projectile.frame++;
|
||||
break;
|
||||
case 5:
|
||||
Projectile.frame++;
|
||||
break;
|
||||
case 6:
|
||||
Projectile.frame++;
|
||||
break;
|
||||
@@ -271,6 +261,8 @@ public class ToclafaneMinion : ModProjectile {
|
||||
Projectile.frame = 4;
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -279,8 +271,8 @@ public class ToclafaneMinion : ModProjectile {
|
||||
#endregion
|
||||
}
|
||||
|
||||
enum AttackMode {
|
||||
MELEE,
|
||||
RANGED
|
||||
private enum AttackMode {
|
||||
Melee,
|
||||
Ranged,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,24 @@
|
||||
using System.Collections.Generic;
|
||||
using Terraria.ModLoader;
|
||||
using YHTMod.Items;
|
||||
|
||||
namespace YHTMod;
|
||||
|
||||
namespace YHTMod {
|
||||
public class YHTMod : Mod {
|
||||
private static YHTMod mod;
|
||||
private static YHTMod _mod;
|
||||
|
||||
public YHTMod() {
|
||||
mod = this;
|
||||
_mod = this;
|
||||
}
|
||||
|
||||
public static YHTMod GetInstance() {
|
||||
return mod;
|
||||
}
|
||||
return _mod;
|
||||
}
|
||||
|
||||
public static HashSet<int> GetAmbitionItems() {
|
||||
return [
|
||||
ModContent.ItemType<SummonersAmbition>(),
|
||||
ModContent.ItemType<WarriorsAmbition>()
|
||||
];
|
||||
}
|
||||
}
|
||||
+4
-4
@@ -1,13 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Import Project="..\tModLoader.targets" />
|
||||
<PropertyGroup>
|
||||
<AssemblyName>YHTMod</AssemblyName>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<LangVersion>latest</LangVersion>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="tModLoader.CodeAssist" Version="0.1.*" />
|
||||
<Reference Include="CalamityMod">
|
||||
<HintPath>..\ModAssemblies\CalamityMod_v2.0.7.2.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
+152
@@ -0,0 +1,152 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.ModLoader.IO;
|
||||
using YHTMod.Buffs;
|
||||
|
||||
namespace YHTMod;
|
||||
|
||||
public class YhtPlayer : ModPlayer {
|
||||
public int ArcaneMissile = 0;
|
||||
public int KatanaTeleportCooldown = 0;
|
||||
public int SummonerAmbitionDeerclopsCooldown = 0;
|
||||
public int SummonerAmbitionPerforatorsCooldown = 0;
|
||||
public int SummonerAmbitionHiveMindCooldown = 0;
|
||||
|
||||
|
||||
public bool SummonerAmbition = false;
|
||||
public bool WarriorAmbition = false;
|
||||
|
||||
/**
|
||||
* Set of boss and event ids for unlocking perks from Summoner's Ambition accessory
|
||||
*/
|
||||
public HashSet<string> SummonerAmbitions = [];
|
||||
public HashSet<string> WarriorAmbitions = [];
|
||||
|
||||
public override void PreUpdate() {
|
||||
KatanaTeleportCooldown = Math.Max(KatanaTeleportCooldown - 1, 0);
|
||||
SummonerAmbitionDeerclopsCooldown = Math.Max(SummonerAmbitionDeerclopsCooldown - 1, 0);
|
||||
SummonerAmbitionPerforatorsCooldown = Math.Max(SummonerAmbitionPerforatorsCooldown - 1, 0);
|
||||
SummonerAmbitionHiveMindCooldown = Math.Max(SummonerAmbitionHiveMindCooldown - 1, 0);
|
||||
}
|
||||
|
||||
public override void PostUpdateEquips() {
|
||||
if (SummonerAmbition) {
|
||||
Player.AddBuff(ModContent.BuffType<SummonerAmbitionBuff>(), 1);
|
||||
Player.maxMinions += GetSummonersAmbitionMinionBonus();
|
||||
|
||||
if (SummonerAmbitions.Contains("king_slime")) {
|
||||
if (ModLoader.HasMod("CalamityMod")) {
|
||||
Player.whipRangeMultiplier += 0.1f;
|
||||
}
|
||||
else {
|
||||
Player.whipRangeMultiplier += 0.2f;
|
||||
}
|
||||
}
|
||||
|
||||
if (ModLoader.HasMod("CalamityMod") && SummonerAmbitions.Contains("desert_scourge")) {
|
||||
Player.statLifeMax2 += 5;
|
||||
}
|
||||
|
||||
if (SummonerAmbitions.Contains("eater_of_worlds")) {
|
||||
Player.GetArmorPenetration(DamageClass.Summon) += 5;
|
||||
}
|
||||
|
||||
if (SummonerAmbitions.Contains("brain_of_cthulhu")) {
|
||||
Player.GetDamage(DamageClass.Summon) += 0.05f;
|
||||
}
|
||||
|
||||
if (SummonerAmbitions.Contains("skeletron")) {
|
||||
Player.GetKnockback(DamageClass.Summon) += 0.1f;
|
||||
}
|
||||
if (ModLoader.HasMod("CalamityMod") && SummonerAmbitions.Contains("slime_god")) {
|
||||
Player.whipRangeMultiplier += 0.1f;
|
||||
}
|
||||
}
|
||||
if (WarriorAmbition) {
|
||||
Player.AddBuff(ModContent.BuffType<WarriorAmbitionBuff>(), 1);
|
||||
Player.statDefense += GetWarriorsAmbitionDefenseBonus();
|
||||
|
||||
if (ModLoader.HasMod("CalamityMod") && SummonerAmbitions.Contains("desert_scourge")) {
|
||||
Player.statLifeMax2 += 10;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public bool hasAmbitionEquipped() {
|
||||
if (SummonerAmbition) return true;
|
||||
if (WarriorAmbition) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void ResetEffects() {
|
||||
ArcaneMissile = 0;
|
||||
SummonerAmbition = false;
|
||||
WarriorAmbition = false;
|
||||
|
||||
base.ResetEffects();
|
||||
}
|
||||
|
||||
public override void SaveData(TagCompound tag) {
|
||||
tag["summonerAmbitions"] = new List<string>(SummonerAmbitions);
|
||||
tag["warriorAmbitions"] = new List<string>(WarriorAmbitions);
|
||||
}
|
||||
|
||||
public override void LoadData(TagCompound tag) {
|
||||
if (tag.ContainsKey("summonerAmbitions")) {
|
||||
IList<string> list = tag.GetList<string>("summonerAmbitions");
|
||||
SummonerAmbitions = new HashSet<string>(list);
|
||||
}
|
||||
if (tag.ContainsKey("warriorAmbitions")) {
|
||||
IList<string> warriorList = tag.GetList<string>("warriorAmbitions");
|
||||
WarriorAmbitions = new HashSet<string>(warriorList);
|
||||
}
|
||||
}
|
||||
|
||||
public int GetSummonersAmbitionMinionBonus() {
|
||||
int amount = 1;
|
||||
if (SummonerAmbitions.Contains("wall_of_flesh")) {
|
||||
amount += 1;
|
||||
}
|
||||
|
||||
return amount;
|
||||
}
|
||||
|
||||
public int GetWarriorsAmbitionDefenseBonus() {
|
||||
int amount = 2;
|
||||
|
||||
if (ModLoader.HasMod("CalamityMod") && SummonerAmbitions.Contains("perforators")) {
|
||||
amount += 2;
|
||||
}
|
||||
|
||||
if (ModLoader.HasMod("CalamityMod") && SummonerAmbitions.Contains("hive_mind")) {
|
||||
amount += 2;
|
||||
}
|
||||
|
||||
if (WarriorAmbitions.Contains("wall_of_flesh")) {
|
||||
amount += 5;
|
||||
}
|
||||
|
||||
return amount;
|
||||
}
|
||||
|
||||
public float GetWarriorsAmbitionMeleeSizeBonus() {
|
||||
float scale = 1f;
|
||||
|
||||
if (WarriorAmbitions.Contains("king_slime")) {
|
||||
if (ModLoader.HasMod("CalamityMod")) {
|
||||
scale += 0.025f;
|
||||
}
|
||||
else {
|
||||
scale += 0.05f;
|
||||
}
|
||||
}
|
||||
|
||||
if (ModLoader.HasMod("CalamityMod") && WarriorAmbitions.Contains("slime_god")) {
|
||||
scale += 0.025f;
|
||||
}
|
||||
|
||||
return scale;
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
displayName = YHT Mod
|
||||
author = YouHaveTrouble
|
||||
version = 1.0.1
|
||||
version = 1.3.2
|
||||
weakReferences = CalamityMod@2.0.0.0
|
||||
|
||||
+3
-1
@@ -1,7 +1,9 @@
|
||||
Bunch of random additions ranging from QoL to random references
|
||||
|
||||
All new content and changes are documented on the wiki.
|
||||
|
||||
Wiki: https://github.com/YouHaveTrouble/YHTMod/wiki
|
||||
Source: https://github.com/YouHaveTrouble/YHTMod
|
||||
|
||||
Code: YouHaveTrouble
|
||||
Sprites: YouHaveTrouble, Patrxon
|
||||
Sprites: YouHaveTrouble, Patrxon, SlyFox
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
A bunch of random additions ranging from QoL to random references
|
||||
|
||||
Steam workshop: https://steamcommunity.com/sharedfiles/filedetails/?id=2897350075
|
||||
|
||||
Mod wiki: https://github.com/YouHaveTrouble/YHTMod/wiki
|
||||
|
||||
Discussion discord: [](https://discord.gg/j8KK5dGBps)
|
||||
|
||||
Code: YouHaveTrouble
|
||||
|
||||
Sprites: YouHaveTrouble, Patrxon
|
||||
Sprites: YouHaveTrouble, Patrxon, SlyFox
|
||||
|
||||
Reference in New Issue
Block a user