Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/Nick-NCSU/DubNationMod in…
Browse files Browse the repository at this point in the history
…to main
  • Loading branch information
Nick-NCSU committed Oct 30, 2021
2 parents 8b48cd7 + 69537bb commit b891eea
Show file tree
Hide file tree
Showing 93 changed files with 13,722 additions and 0 deletions.
Binary file added .vs/DubNation/DesignTimeBuild/.dtbcache.v2
Binary file not shown.
1,025 changes: 1,025 additions & 0 deletions .vs/DubNation/config/applicationhost.config

Large diffs are not rendered by default.

Binary file added .vs/DubNation/v15/.suo
Binary file not shown.
Binary file added .vs/DubNation/v16/.suo
Binary file not shown.
6 changes: 6 additions & 0 deletions .vs/VSWorkspaceState.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"ExpandedNodes": [
""
],
"PreviewInSolutionExplorer": false
}
Binary file added .vs/slnx.sqlite
Binary file not shown.
32 changes: 32 additions & 0 deletions Buffs/StoneBuff.cs
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--;
}
}
}
}
Binary file added Buffs/StoneBuff.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 32 additions & 0 deletions Buffs/WoodBuff.cs
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--;
}
}
}
}
Binary file added Buffs/WoodBuff.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions DubNation.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
using Terraria.ModLoader;

namespace DubNation
{
public class DubNation : Mod
{
}
}
16 changes: 16 additions & 0 deletions DubNation.csproj
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="&quot;$(tMLBuildServerPath)&quot; -build $(ProjectDir) -eac $(TargetPath) -define &quot;$(DefineConstants)&quot; -unsafe $(AllowUnsafeBlocks)" />
</Target>
<ItemGroup>
<PackageReference Include="tModLoader.CodeAssist" Version="0.1.*" />
</ItemGroup>
</Project>
25 changes: 25 additions & 0 deletions DubNation.sln
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
53 changes: 53 additions & 0 deletions Items/StoneStaff.cs
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();
}
}
}
Binary file added Items/StoneStaff.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
54 changes: 54 additions & 0 deletions Items/WoodStaff.cs
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();
}
}
}
Binary file added Items/WoodStaff.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Items/adamantitestaff.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Items/chlorophytestaff.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Items/cobaltstaff.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Items/copperstaff.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Items/crimtanestaff.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Items/demonitestaff.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Items/goldstaff.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Items/hallowedstaff.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Items/hellstonestaff.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Items/ironstaff.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Items/leadstaff.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Items/luminitestaff.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Items/meteoritestaff.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Items/mythrilstaff.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Items/orichalcumstaff.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Items/palladiumstaff.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Items/platinumstaff.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Items/shroomitestaff.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Items/silverstaff.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Items/spectrestaff.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Items/tinstaff.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Items/titaniumstaff.png
Binary file added Items/tungstenstaff.png
101 changes: 101 additions & 0 deletions Projectiles/StoneMinion.cs
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

}
}
}
Binary file added Projectiles/StoneMinion.png
Loading

0 comments on commit b891eea

Please sign in to comment.