mirror of
https://github.com/YouHaveTrouble/YHTMod.git
synced 2026-05-11 21:56:54 +00:00
first successful calamity boss perk integration
This commit is contained in:
@@ -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 |
+36
-27
@@ -1,3 +1,6 @@
|
||||
using System.Collections.Generic;
|
||||
using CalamityMod.NPCs.Crabulon;
|
||||
using CalamityMod.NPCs.DesertScourge;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.Chat;
|
||||
@@ -8,17 +11,34 @@ using Terraria.ModLoader;
|
||||
namespace YHTMod.Changes;
|
||||
|
||||
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");
|
||||
|
||||
if (ModLoader.HasMod("CalamityMod")) {
|
||||
BossIds.Add(ModContent.NPCType<DesertScourgeHead>(), "desert_scourge");
|
||||
BossIds.Add(ModContent.NPCType<Crabulon>(), "crabulon");
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnKill(NPC npc) {
|
||||
switch (npc.type) {
|
||||
case NPCID.KingSlime:
|
||||
HandleBossKill(npc, "king_slime");
|
||||
break;
|
||||
case NPCID.EyeofCthulhu:
|
||||
HandleBossKill(npc, "eye_of_cthulhu");
|
||||
break;
|
||||
case NPCID.EaterofWorldsHead:
|
||||
case NPCID.EaterofWorldsBody:
|
||||
case NPCID.EaterofWorldsTail:
|
||||
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;
|
||||
@@ -28,26 +48,15 @@ public class BossKillListener : GlobalNPC {
|
||||
) continue;
|
||||
if (++foundEaterSegments > 1) break;
|
||||
}
|
||||
|
||||
HandleBossKill(npc, "eater_of_worlds");
|
||||
break;
|
||||
case NPCID.BrainofCthulhu:
|
||||
HandleBossKill(npc, "brain_of_cthulhu");
|
||||
break;
|
||||
case NPCID.Deerclops:
|
||||
HandleBossKill(npc, "deerclops");
|
||||
break;
|
||||
case NPCID.QueenBee:
|
||||
HandleBossKill(npc, "queen_bee");
|
||||
break;
|
||||
case NPCID.SkeletronHead:
|
||||
HandleBossKill(npc, "skeletron");
|
||||
break;
|
||||
case NPCID.WallofFlesh:
|
||||
HandleBossKill(npc, "wall_of_flesh");
|
||||
if (foundEaterSegments > 1) {
|
||||
base.OnKill(npc);
|
||||
return;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
HandleBossKill(npc, id);
|
||||
base.OnKill(npc);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using YHTMod.Buffs;
|
||||
using Vector2 = Microsoft.Xna.Framework.Vector2;
|
||||
|
||||
namespace YHTMod.Changes;
|
||||
@@ -40,10 +41,16 @@ public class SummonerOnHitEffects : GlobalProjectile {
|
||||
}
|
||||
|
||||
// Whips
|
||||
if (projectile.WhipSettings.Segments > 0) {
|
||||
if (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);
|
||||
|
||||
@@ -39,11 +39,23 @@ public class SummonersAmbition : ModItem {
|
||||
tooltips.Add(new TooltipLine(Mod, "SummonerAmbitionKingSlime",
|
||||
Language.GetTextValue("Mods.YHTMod.Items.SummonersAmbition.KingSlime")));
|
||||
}
|
||||
|
||||
if (ModLoader.HasMod("CalamityMod") && player.SummonerAmbitions.Contains("desert_scourge")) {
|
||||
int id = ModContent.ItemType<CalamityMod.Items.LoreItems.LoreDesertScourge>();
|
||||
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 = ModContent.ItemType<CalamityMod.Items.LoreItems.LoreCrabulon>();
|
||||
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",
|
||||
|
||||
@@ -6,18 +6,27 @@ Recipes: {
|
||||
Buffs: {
|
||||
ToclafaneMinionBuff: {
|
||||
DisplayName: Summon Toclafane
|
||||
Description: It came from a parallel world to fight for its Master.
|
||||
Description: It came from a parallel world to fight for its Master
|
||||
}
|
||||
|
||||
SummonerAmbitionBuff: {
|
||||
DisplayName: Summoner's Ambition
|
||||
Description:
|
||||
'''
|
||||
Your power grows with your ambition.
|
||||
Your power grows with your ambition
|
||||
|
||||
Essences absorbed: {0}
|
||||
'''
|
||||
}
|
||||
|
||||
ShroomGlowDebuff: {
|
||||
DisplayName: Shroom Glow
|
||||
Description:
|
||||
'''
|
||||
You are emitting a faint glow...
|
||||
And smell like mushrooms.
|
||||
'''
|
||||
}
|
||||
}
|
||||
|
||||
Items: {
|
||||
@@ -74,7 +83,9 @@ Items: {
|
||||
{$CommonItemTooltip.IncreasesMaxMinionsBy@0}
|
||||
'''
|
||||
KingSlime: "[i:560] 20% 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"
|
||||
QueenBee: "[i:1133] Minion hits can inflict poison"
|
||||
|
||||
@@ -5,4 +5,9 @@
|
||||
<AssemblyName>YHTMod</AssemblyName>
|
||||
<LangVersion>latest</LangVersion>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="CalamityMod">
|
||||
<HintPath>..\ModAssemblies\CalamityMod_v2.0.7.2.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -33,6 +33,10 @@ public class YhtPlayer : ModPlayer {
|
||||
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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user