-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/Nick-NCSU/DubNationMod in…
…to main
- Loading branch information
Showing
93 changed files
with
13,722 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"ExpandedNodes": [ | ||
"" | ||
], | ||
"PreviewInSolutionExplorer": false | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
using Microsoft.Xna.Framework; | ||
using System; | ||
using Terraria; | ||
using Terraria.ID; | ||
using Terraria.ModLoader; | ||
|
||
namespace DubNation.Buffs | ||
{ | ||
public class StoneBuff : ModBuff | ||
{ | ||
public override void SetDefaults() | ||
{ | ||
DisplayName.SetDefault("Boulder"); | ||
Description.SetDefault("The boulder minion will fight for you"); | ||
Main.buffNoSave[Type] = true; | ||
Main.buffNoTimeDisplay[Type] = true; | ||
} | ||
|
||
public override void Update(Player player, ref int buffIndex) | ||
{ | ||
if (player.ownedProjectileCounts[ModContent.ProjectileType<Projectiles.StoneMinion>()] > 0) | ||
{ | ||
player.buffTime[buffIndex] = 18000; | ||
} | ||
else | ||
{ | ||
player.DelBuff(buffIndex); | ||
buffIndex--; | ||
} | ||
} | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
using Microsoft.Xna.Framework; | ||
using System; | ||
using Terraria; | ||
using Terraria.ID; | ||
using Terraria.ModLoader; | ||
|
||
namespace DubNation.Buffs | ||
{ | ||
public class WoodBuff : ModBuff | ||
{ | ||
public override void SetDefaults() | ||
{ | ||
DisplayName.SetDefault("Coat Rack"); | ||
Description.SetDefault("The coat rack minion will fight for you"); | ||
Main.buffNoSave[Type] = true; | ||
Main.buffNoTimeDisplay[Type] = true; | ||
} | ||
|
||
public override void Update(Player player, ref int buffIndex) | ||
{ | ||
if (player.ownedProjectileCounts[ModContent.ProjectileType<Projectiles.WoodMinion>()] > 0) | ||
{ | ||
player.buffTime[buffIndex] = 18000; | ||
} | ||
else | ||
{ | ||
player.DelBuff(buffIndex); | ||
buffIndex--; | ||
} | ||
} | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
using Terraria.ModLoader; | ||
|
||
namespace DubNation | ||
{ | ||
public class DubNation : Mod | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<Import Project="..\..\references\tModLoader.targets" /> | ||
<PropertyGroup> | ||
<AssemblyName>DubNation</AssemblyName> | ||
<TargetFramework>net45</TargetFramework> | ||
<PlatformTarget>x86</PlatformTarget> | ||
<LangVersion>7.3</LangVersion> | ||
</PropertyGroup> | ||
<Target Name="BuildMod" AfterTargets="Build"> | ||
<Exec Command=""$(tMLBuildServerPath)" -build $(ProjectDir) -eac $(TargetPath) -define "$(DefineConstants)" -unsafe $(AllowUnsafeBlocks)" /> | ||
</Target> | ||
<ItemGroup> | ||
<PackageReference Include="tModLoader.CodeAssist" Version="0.1.*" /> | ||
</ItemGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio Version 16 | ||
VisualStudioVersion = 16.0.31727.386 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DubNation", "DubNation.csproj", "{1C73C392-6CDC-4E67-8A0E-2780F8DC5EEB}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{1C73C392-6CDC-4E67-8A0E-2780F8DC5EEB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{1C73C392-6CDC-4E67-8A0E-2780F8DC5EEB}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{1C73C392-6CDC-4E67-8A0E-2780F8DC5EEB}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{1C73C392-6CDC-4E67-8A0E-2780F8DC5EEB}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {FA0CCD90-E829-4EE3-AB3A-F2F288CC401E} | ||
EndGlobalSection | ||
EndGlobal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
using Microsoft.Xna.Framework; | ||
using System; | ||
using Terraria; | ||
using Terraria.ID; | ||
using Terraria.ModLoader; | ||
|
||
namespace DubNation.Items | ||
{ | ||
class StoneStaff : ModItem | ||
{ | ||
public override void SetStaticDefaults() | ||
{ | ||
DisplayName.SetDefault("Stone Staff"); | ||
Tooltip.SetDefault("Summons a boulder minion to fight for you. Breaks after 10 attacks."); | ||
ItemID.Sets.GamepadWholeScreenUseRange[item.type] = true; | ||
ItemID.Sets.LockOnIgnoresCollision[item.type] = true; | ||
} | ||
|
||
public override void SetDefaults() | ||
{ | ||
item.damage = 21; | ||
item.width = 40; | ||
item.height = 40; | ||
item.useTime = 60; | ||
item.useAnimation = 60; | ||
item.useStyle = ItemUseStyleID.SwingThrow; | ||
item.value = 10; | ||
item.rare = ItemRarityID.White; | ||
item.UseSound = SoundID.Item1; | ||
item.mana = 10; | ||
item.noMelee = true; | ||
item.summon = true; | ||
item.buffType = ModContent.BuffType<Buffs.StoneBuff>(); | ||
item.shoot = ModContent.ProjectileType<Projectiles.StoneMinion>(); | ||
} | ||
|
||
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) | ||
{ | ||
player.AddBuff(item.buffType, 2); | ||
position = Main.MouseWorld; | ||
return true; | ||
} | ||
|
||
public override void AddRecipes() | ||
{ | ||
ModRecipe recipe = new ModRecipe(mod); | ||
recipe.AddIngredient(ItemID.StoneBlock, 36); | ||
recipe.AddTile(TileID.WorkBenches); | ||
recipe.SetResult(this); | ||
recipe.AddRecipe(); | ||
} | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
using Microsoft.Xna.Framework; | ||
using System; | ||
using Terraria; | ||
using Terraria.ID; | ||
using Terraria.ModLoader; | ||
|
||
|
||
namespace DubNation.Items | ||
{ | ||
public class WoodStaff : ModItem | ||
{ | ||
public override void SetStaticDefaults() | ||
{ | ||
DisplayName.SetDefault("Wood Staff"); | ||
Tooltip.SetDefault("Summons a coat rack minion to fight for you"); | ||
ItemID.Sets.GamepadWholeScreenUseRange[item.type] = true; | ||
ItemID.Sets.LockOnIgnoresCollision[item.type] = true; | ||
} | ||
|
||
public override void SetDefaults() | ||
{ | ||
item.damage = 6; | ||
item.width = 40; | ||
item.height = 40; | ||
item.useTime = 36; | ||
item.useAnimation = 36; | ||
item.useStyle = ItemUseStyleID.SwingThrow; | ||
item.value = 10; | ||
item.rare = ItemRarityID.White; | ||
item.UseSound = SoundID.Item1; | ||
item.mana = 1; | ||
item.noMelee = true; | ||
item.summon = true; | ||
item.buffType = ModContent.BuffType<Buffs.WoodBuff>(); | ||
item.shoot = ModContent.ProjectileType<Projectiles.WoodMinion>(); | ||
} | ||
|
||
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) | ||
{ | ||
player.AddBuff(item.buffType, 2); | ||
position = Main.MouseWorld; | ||
return true; | ||
} | ||
|
||
public override void AddRecipes() | ||
{ | ||
ModRecipe recipe = new ModRecipe(mod); | ||
recipe.AddIngredient(ItemID.Wood, 12); | ||
recipe.AddTile(TileID.WorkBenches); | ||
recipe.SetResult(this); | ||
recipe.AddRecipe(); | ||
} | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
using Microsoft.Xna.Framework; | ||
using System; | ||
using Terraria; | ||
using Terraria.ID; | ||
using Terraria.ModLoader; | ||
|
||
namespace DubNation.Projectiles | ||
{ | ||
public class StoneMinion : ModProjectile | ||
{ | ||
public override void SetStaticDefaults() | ||
{ | ||
DisplayName.SetDefault("Boulder"); | ||
// Sets the amount of frames this minion has on its spritesheet | ||
Main.projFrames[projectile.type] = 1; | ||
// This is necessary for right-click targeting | ||
ProjectileID.Sets.MinionTargettingFeature[projectile.type] = true; | ||
|
||
// These below are needed for a minion | ||
// Denotes that this projectile is a pet or minion | ||
Main.projPet[projectile.type] = true; | ||
// This is needed so your minion can properly spawn when summoned and replaced when other minions are summoned | ||
ProjectileID.Sets.MinionSacrificable[projectile.type] = true; | ||
// Don't mistake this with "if this is true, then it will automatically home". It is just for damage reduction for certain NPCs | ||
ProjectileID.Sets.Homing[projectile.type] = true; | ||
} | ||
|
||
public sealed override void SetDefaults() | ||
{ | ||
projectile.width = 96; | ||
projectile.height = 96; | ||
// Makes the minion go through tiles freely | ||
projectile.tileCollide = true; | ||
|
||
// These below are needed for a minion weapon | ||
// Only controls if it deals damage to enemies on contact (more on that later) | ||
projectile.friendly = true; | ||
// Only determines the damage type | ||
projectile.minion = true; | ||
// Amount of slots this minion occupies from the total minion slots available to the player (more on that later) | ||
projectile.minionSlots = 1f; | ||
// Needed so the minion doesn't despawn on collision with enemies or tiles | ||
projectile.penetrate = 10; | ||
} | ||
|
||
// Here you can decide if your minion breaks things like grass or pots | ||
public override bool? CanCutTiles() | ||
{ | ||
return false; | ||
} | ||
|
||
// This is mandatory if your minion deals contact damage (further related stuff in AI() in the Movement region) | ||
public override bool MinionContactDamage() | ||
{ | ||
return true; | ||
} | ||
|
||
public override void AI() | ||
{ | ||
Player player = Main.player[projectile.owner]; | ||
|
||
#region Active check | ||
// This is the "active check", makes sure the minion is alive while the player is alive, and despawns if not | ||
if (player.dead || !player.active) | ||
{ | ||
player.ClearBuff(ModContent.BuffType<Buffs.WoodBuff>()); | ||
} | ||
if (player.HasBuff(ModContent.BuffType<Buffs.WoodBuff>())) | ||
{ | ||
projectile.timeLeft = 2; | ||
} | ||
#endregion | ||
#region Movement | ||
Vector2 down = new Vector2(0, 1); | ||
projectile.velocity = (projectile.velocity + down); | ||
#endregion | ||
|
||
#region Animation and visuals | ||
// So it will lean slightly towards the direction it's moving | ||
projectile.rotation = projectile.velocity.X * 0.05f; | ||
|
||
// This is a simple "loop through all frames from top to bottom" animation | ||
int frameSpeed = 5; | ||
projectile.frameCounter++; | ||
if (projectile.frameCounter >= frameSpeed) | ||
{ | ||
projectile.frameCounter = 0; | ||
projectile.frame++; | ||
if (projectile.frame >= Main.projFrames[projectile.type]) | ||
{ | ||
projectile.frame = 0; | ||
} | ||
} | ||
|
||
// Some visuals here | ||
Lighting.AddLight(projectile.Center, Color.White.ToVector3() * 0.78f); | ||
#endregion | ||
|
||
} | ||
} | ||
} |
Oops, something went wrong.
Oops, something went wrong.