0.2.0 commit
This commit is contained in:
commit
b861945511
261
.gitignore
vendored
Normal file
261
.gitignore
vendored
Normal file
@ -0,0 +1,261 @@
|
||||
## Ignore Visual Studio temporary files, build results, and
|
||||
## files generated by popular Visual Studio add-ons.
|
||||
|
||||
# User-specific files
|
||||
*.suo
|
||||
*.user
|
||||
*.userosscache
|
||||
*.sln.docstates
|
||||
|
||||
# User-specific files (MonoDevelop/Xamarin Studio)
|
||||
*.userprefs
|
||||
|
||||
# Build results
|
||||
[Dd]ebug/
|
||||
[Dd]ebugPublic/
|
||||
[Rr]elease/
|
||||
[Rr]eleases/
|
||||
x64/
|
||||
x86/
|
||||
bld/
|
||||
[Bb]in/
|
||||
[Oo]bj/
|
||||
[Ll]og/
|
||||
|
||||
# Visual Studio 2015 cache/options directory
|
||||
.vs/
|
||||
# Uncomment if you have tasks that create the project's static files in wwwroot
|
||||
#wwwroot/
|
||||
|
||||
# MSTest test Results
|
||||
[Tt]est[Rr]esult*/
|
||||
[Bb]uild[Ll]og.*
|
||||
|
||||
# NUNIT
|
||||
*.VisualState.xml
|
||||
TestResult.xml
|
||||
|
||||
# Build Results of an ATL Project
|
||||
[Dd]ebugPS/
|
||||
[Rr]eleasePS/
|
||||
dlldata.c
|
||||
|
||||
# DNX
|
||||
project.lock.json
|
||||
project.fragment.lock.json
|
||||
artifacts/
|
||||
|
||||
*_i.c
|
||||
*_p.c
|
||||
*_i.h
|
||||
*.ilk
|
||||
*.meta
|
||||
*.obj
|
||||
*.pch
|
||||
*.pdb
|
||||
*.pgc
|
||||
*.pgd
|
||||
*.rsp
|
||||
*.sbr
|
||||
*.tlb
|
||||
*.tli
|
||||
*.tlh
|
||||
*.tmp
|
||||
*.tmp_proj
|
||||
*.log
|
||||
*.vspscc
|
||||
*.vssscc
|
||||
.builds
|
||||
*.pidb
|
||||
*.svclog
|
||||
*.scc
|
||||
|
||||
# Chutzpah Test files
|
||||
_Chutzpah*
|
||||
|
||||
# Visual C++ cache files
|
||||
ipch/
|
||||
*.aps
|
||||
*.ncb
|
||||
*.opendb
|
||||
*.opensdf
|
||||
*.sdf
|
||||
*.cachefile
|
||||
*.VC.db
|
||||
*.VC.VC.opendb
|
||||
|
||||
# Visual Studio profiler
|
||||
*.psess
|
||||
*.vsp
|
||||
*.vspx
|
||||
*.sap
|
||||
|
||||
# TFS 2012 Local Workspace
|
||||
$tf/
|
||||
|
||||
# Guidance Automation Toolkit
|
||||
*.gpState
|
||||
|
||||
# ReSharper is a .NET coding add-in
|
||||
_ReSharper*/
|
||||
*.[Rr]e[Ss]harper
|
||||
*.DotSettings.user
|
||||
|
||||
# JustCode is a .NET coding add-in
|
||||
.JustCode
|
||||
|
||||
# TeamCity is a build add-in
|
||||
_TeamCity*
|
||||
|
||||
# DotCover is a Code Coverage Tool
|
||||
*.dotCover
|
||||
|
||||
# NCrunch
|
||||
_NCrunch_*
|
||||
.*crunch*.local.xml
|
||||
nCrunchTemp_*
|
||||
|
||||
# MightyMoose
|
||||
*.mm.*
|
||||
AutoTest.Net/
|
||||
|
||||
# Web workbench (sass)
|
||||
.sass-cache/
|
||||
|
||||
# Installshield output folder
|
||||
[Ee]xpress/
|
||||
|
||||
# DocProject is a documentation generator add-in
|
||||
DocProject/buildhelp/
|
||||
DocProject/Help/*.HxT
|
||||
DocProject/Help/*.HxC
|
||||
DocProject/Help/*.hhc
|
||||
DocProject/Help/*.hhk
|
||||
DocProject/Help/*.hhp
|
||||
DocProject/Help/Html2
|
||||
DocProject/Help/html
|
||||
|
||||
# Click-Once directory
|
||||
publish/
|
||||
|
||||
# Publish Web Output
|
||||
*.[Pp]ublish.xml
|
||||
*.azurePubxml
|
||||
# TODO: Comment the next line if you want to checkin your web deploy settings
|
||||
# but database connection strings (with potential passwords) will be unencrypted
|
||||
#*.pubxml
|
||||
*.publishproj
|
||||
|
||||
# Microsoft Azure Web App publish settings. Comment the next line if you want to
|
||||
# checkin your Azure Web App publish settings, but sensitive information contained
|
||||
# in these scripts will be unencrypted
|
||||
PublishScripts/
|
||||
|
||||
# NuGet Packages
|
||||
*.nupkg
|
||||
# The packages folder can be ignored because of Package Restore
|
||||
**/packages/*
|
||||
# except build/, which is used as an MSBuild target.
|
||||
!**/packages/build/
|
||||
# Uncomment if necessary however generally it will be regenerated when needed
|
||||
#!**/packages/repositories.config
|
||||
# NuGet v3's project.json files produces more ignoreable files
|
||||
*.nuget.props
|
||||
*.nuget.targets
|
||||
|
||||
# Microsoft Azure Build Output
|
||||
csx/
|
||||
*.build.csdef
|
||||
|
||||
# Microsoft Azure Emulator
|
||||
ecf/
|
||||
rcf/
|
||||
|
||||
# Windows Store app package directories and files
|
||||
AppPackages/
|
||||
BundleArtifacts/
|
||||
Package.StoreAssociation.xml
|
||||
_pkginfo.txt
|
||||
|
||||
# Visual Studio cache files
|
||||
# files ending in .cache can be ignored
|
||||
*.[Cc]ache
|
||||
# but keep track of directories ending in .cache
|
||||
!*.[Cc]ache/
|
||||
|
||||
# Others
|
||||
ClientBin/
|
||||
~$*
|
||||
*~
|
||||
*.dbmdl
|
||||
*.dbproj.schemaview
|
||||
*.jfm
|
||||
*.pfx
|
||||
*.publishsettings
|
||||
node_modules/
|
||||
orleans.codegen.cs
|
||||
|
||||
# Since there are multiple workflows, uncomment next line to ignore bower_components
|
||||
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
|
||||
#bower_components/
|
||||
|
||||
# RIA/Silverlight projects
|
||||
Generated_Code/
|
||||
|
||||
# Backup & report files from converting an old project file
|
||||
# to a newer Visual Studio version. Backup files are not needed,
|
||||
# because we have git ;-)
|
||||
_UpgradeReport_Files/
|
||||
Backup*/
|
||||
UpgradeLog*.XML
|
||||
UpgradeLog*.htm
|
||||
|
||||
# SQL Server files
|
||||
*.mdf
|
||||
*.ldf
|
||||
|
||||
# Business Intelligence projects
|
||||
*.rdl.data
|
||||
*.bim.layout
|
||||
*.bim_*.settings
|
||||
|
||||
# Microsoft Fakes
|
||||
FakesAssemblies/
|
||||
|
||||
# GhostDoc plugin setting file
|
||||
*.GhostDoc.xml
|
||||
|
||||
# Node.js Tools for Visual Studio
|
||||
.ntvs_analysis.dat
|
||||
|
||||
# Visual Studio 6 build log
|
||||
*.plg
|
||||
|
||||
# Visual Studio 6 workspace options file
|
||||
*.opt
|
||||
|
||||
# Visual Studio LightSwitch build output
|
||||
**/*.HTMLClient/GeneratedArtifacts
|
||||
**/*.DesktopClient/GeneratedArtifacts
|
||||
**/*.DesktopClient/ModelManifest.xml
|
||||
**/*.Server/GeneratedArtifacts
|
||||
**/*.Server/ModelManifest.xml
|
||||
_Pvt_Extensions
|
||||
|
||||
# Paket dependency manager
|
||||
.paket/paket.exe
|
||||
paket-files/
|
||||
|
||||
# FAKE - F# Make
|
||||
.fake/
|
||||
|
||||
# JetBrains Rider
|
||||
.idea/
|
||||
*.sln.iml
|
||||
|
||||
# CodeRush
|
||||
.cr/
|
||||
|
||||
# Python Tools for Visual Studio (PTVS)
|
||||
__pycache__/
|
||||
*.pyc
|
23
Content/Items/Materials/FrozenTablet.cs
Normal file
23
Content/Items/Materials/FrozenTablet.cs
Normal file
@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria;
|
||||
|
||||
namespace tMx.Content.Items.Materials
|
||||
{
|
||||
public class FrozenTablet : ModItem
|
||||
{
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.ResearchUnlockCount = 666;
|
||||
Item.value = Item.buyPrice(gold: 1);
|
||||
Item.rare = ItemRarityID.Blue;
|
||||
Item.material = true;
|
||||
Item.maxStack = 666;
|
||||
}
|
||||
}
|
||||
}
|
BIN
Content/Items/Materials/FrozenTablet.png
Normal file
BIN
Content/Items/Materials/FrozenTablet.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.8 KiB |
BIN
Content/Items/Materials/FrozenTablet.psd
Normal file
BIN
Content/Items/Materials/FrozenTablet.psd
Normal file
Binary file not shown.
23
Content/Items/Materials/MoltenTablet.cs
Normal file
23
Content/Items/Materials/MoltenTablet.cs
Normal file
@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria;
|
||||
|
||||
namespace tMx.Content.Items.Materials
|
||||
{
|
||||
public class MoltenTablet : ModItem
|
||||
{
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.ResearchUnlockCount = 666;
|
||||
Item.value = Item.buyPrice(gold: 1);
|
||||
Item.rare = ItemRarityID.Red;
|
||||
Item.material = true;
|
||||
Item.maxStack = 666;
|
||||
}
|
||||
}
|
||||
}
|
BIN
Content/Items/Materials/MoltenTablet.png
Normal file
BIN
Content/Items/Materials/MoltenTablet.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.9 KiB |
BIN
Content/Items/Materials/MoltenTablet.psd
Normal file
BIN
Content/Items/Materials/MoltenTablet.psd
Normal file
Binary file not shown.
47
Content/Items/Weapons/Boomrangs/MeteorHammer.cs
Normal file
47
Content/Items/Weapons/Boomrangs/MeteorHammer.cs
Normal file
@ -0,0 +1,47 @@
|
||||
using System;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
namespace tMx.Content.Items.Weapons.Boomrangs
|
||||
{
|
||||
public class MeteorHammer : ModItem
|
||||
{
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.damage = 80;
|
||||
Item.DamageType = DamageClass.Melee;
|
||||
Item.width = 30;
|
||||
Item.height = 30;
|
||||
Item.useTime = 5;
|
||||
Item.useAnimation = 10;
|
||||
Item.noUseGraphic = true;
|
||||
Item.useStyle = 1;
|
||||
Item.knockBack = 3;
|
||||
Item.value = 8;
|
||||
Item.rare = ItemRarityID.Orange;
|
||||
Item.shootSpeed = 12f;
|
||||
Item.shoot = ModContent.ProjectileType<Content.Projectiles.MeteorHammerProjectile>();
|
||||
Item.UseSound = SoundID.Item1;
|
||||
Item.autoReuse = true;
|
||||
}
|
||||
public override void AddRecipes()
|
||||
{
|
||||
Recipe recipe = CreateRecipe();
|
||||
recipe.AddIngredient(ItemID.DirtBlock, 10);
|
||||
recipe.AddTile(TileID.WorkBenches);
|
||||
recipe.Register();
|
||||
}
|
||||
public override bool CanUseItem(Player player) //this make that you can shoot only 1 boomerang at once
|
||||
{
|
||||
for (int i = 0; i < 1000; ++i)
|
||||
{
|
||||
if (Main.projectile[i].active && Main.projectile[i].owner == Main.myPlayer && Main.projectile[i].type == Item.shoot)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
BIN
Content/Items/Weapons/Boomrangs/MeteorHammer.png
Normal file
BIN
Content/Items/Weapons/Boomrangs/MeteorHammer.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 501 B |
37
Content/Items/tMxSword.cs
Normal file
37
Content/Items/tMxSword.cs
Normal file
@ -0,0 +1,37 @@
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace tMx.Content.Items
|
||||
{
|
||||
// This is a basic item template.
|
||||
// Please see tModLoader's ExampleMod for every other example:
|
||||
// https://github.com/tModLoader/tModLoader/tree/stable/ExampleMod
|
||||
public class tMxSword : ModItem
|
||||
{
|
||||
// The Display Name and Tooltip of this item can be edited in the 'Localization/en-US_Mods.tMx.hjson' file.
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.damage = 50;
|
||||
Item.DamageType = DamageClass.Melee;
|
||||
Item.width = 40;
|
||||
Item.height = 40;
|
||||
Item.useTime = 20;
|
||||
Item.useAnimation = 20;
|
||||
Item.useStyle = ItemUseStyleID.Swing;
|
||||
Item.knockBack = 6;
|
||||
Item.value = Item.buyPrice(silver: 1);
|
||||
Item.rare = ItemRarityID.Blue;
|
||||
Item.UseSound = SoundID.Item1;
|
||||
Item.autoReuse = true;
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
Recipe recipe = CreateRecipe();
|
||||
recipe.AddIngredient(ItemID.DirtBlock, 10);
|
||||
recipe.AddTile(TileID.WorkBenches);
|
||||
recipe.Register();
|
||||
}
|
||||
}
|
||||
}
|
BIN
Content/Items/tMxSword.png
Normal file
BIN
Content/Items/tMxSword.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 720 B |
86
Content/Projectiles/MeteorHammerProjectile.cs
Normal file
86
Content/Projectiles/MeteorHammerProjectile.cs
Normal file
@ -0,0 +1,86 @@
|
||||
using tMx.Content.Items;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using System;
|
||||
using Terraria.Audio;
|
||||
using Microsoft.Xna.Framework;
|
||||
|
||||
namespace tMx.Content.Projectiles
|
||||
{
|
||||
// This file showcases the concept of piercing.
|
||||
// The code of the item that spawns it is located at the bottom.
|
||||
|
||||
// NPC.immune determines if an npc can be hit by a item or projectile owned by a particular player (it is an array, each slot corresponds to different players (whoAmI))
|
||||
// NPC.immune is decremented towards 0 every update
|
||||
// Melee items set NPC.immune to player.itemAnimation, which starts at item.useAnimation and decrements towards 0
|
||||
// Projectiles, however, provide mechanisms for custom immunity.
|
||||
// 1. penetrate == 1: A projectile with penetrate set to 1 in SetDefaults will hit regardless of the NPC's immunity counters (The penetrate from SetDefaults is remembered in maxPenetrate)
|
||||
// Ex: Wooden Arrow.
|
||||
// 2. No code and penetrate > 1, penetrate == -1, or (appliesImmunityTimeOnSingleHits && penetrate == 1): npc.immune[owner] will be set to 10.
|
||||
// The NPC will be hit if not immune and will become immune to all damage for 10 ticks
|
||||
// Ex: Unholy Arrow
|
||||
// 3. Override OnHitNPC: If not immune, when it hits it manually set an immune other than 10
|
||||
// Ex: Arkhalis: Sets it to 5
|
||||
// Ex: Sharknado Minion: Sets to 20
|
||||
// Video: https://media-1.discordapp.net/attachments/242228770855976960/1150275205017636995/Projectile_Immunity_Sharknado_Arkhalis_Example.mp4 Notice how Sharknado minion hits prevent Arkhalis hits for a brief moment.
|
||||
// 4. Projectile.usesIDStaticNPCImmunity and Projectile.idStaticNPCHitCooldown: Specifies that a type of projectile has a shared immunity timer for each npc.
|
||||
// Use this if you want other projectiles a chance to damage, but don't want the same projectile type to hit an npc rapidly.
|
||||
// Ex: Ghastly Glaive is the only one who uses this.
|
||||
// 5. Projectile.usesLocalNPCImmunity and Projectile.localNPCHitCooldown: Specifies the projectile manages it's own immunity timers for each npc
|
||||
// Use this if you want the multiple projectiles of the same type to have a chance to attack rapidly, but don't want a single projectile to hit rapidly. A -1 value prevents the same projectile from ever hitting the npc again.
|
||||
// Ex: Lightning Aura sentries use this. (localNPCHitCooldown = 3, but other code controls how fast the projectile itself hits)
|
||||
// Overlapping Auras all have a chance to hit after each other even though they share the same ID.
|
||||
// Try the above by uncommenting out the respective bits of code in the projectile below.
|
||||
|
||||
// This is a simple item that is based on the FlintlockPistol and shoots ExamplePiercingProjectile to showcase it.
|
||||
internal class MeteorHammerProjectile : ModProjectile
|
||||
{
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Projectile.width = 8; // The width of projectile hitbox
|
||||
Projectile.height = 8; // The height of projectile hitbox
|
||||
Projectile.aiStyle = 1; // The ai style of the projectile, please reference the source code of Terraria
|
||||
Projectile.friendly = true; // Can the projectile deal damage to enemies?
|
||||
Projectile.hostile = false; // Can the projectile deal damage to the player?
|
||||
Projectile.DamageType = DamageClass.Melee; // Is the projectile shoot by a ranged weapon?
|
||||
Projectile.penetrate = 0; // How many monsters the projectile can penetrate. (OnTileCollide below also decrements penetrate for bounces as well)
|
||||
Projectile.timeLeft = 60; // The live time for the projectile (60 = 1 second, so 600 is 10 seconds)
|
||||
Projectile.alpha = 5; // The transparency of the projectile, 255 for completely transparent. (aiStyle 1 quickly fades the projectile in) Make sure to delete this if you aren't using an aiStyle that fades in. You'll wonder why your projectile is invisible.
|
||||
Projectile.light = 10.0f; // How much light emit around the projectile
|
||||
Projectile.ignoreWater = true; // Does the projectile's speed be influenced by water?
|
||||
Projectile.tileCollide = true; // Can the projectile collide with tiles?
|
||||
Projectile.extraUpdates = 1; // Set to above 0 if you want the projectile to update multiple time in a frame
|
||||
}
|
||||
|
||||
public override bool OnTileCollide(Vector2 oldVelocity)
|
||||
{
|
||||
// If collide with tile, reduce the penetrate.
|
||||
// So the projectile can reflect at most 5 times
|
||||
Projectile.penetrate--;
|
||||
if (Projectile.penetrate <= 0)
|
||||
{
|
||||
Projectile.Kill();
|
||||
}
|
||||
else
|
||||
{
|
||||
Collision.HitTiles(Projectile.position, Projectile.velocity, Projectile.width, Projectile.height);
|
||||
SoundEngine.PlaySound(SoundID.Item10, Projectile.position);
|
||||
|
||||
// If the projectile hits the left or right side of the tile, reverse the X velocity
|
||||
if (Math.Abs(Projectile.velocity.X - oldVelocity.X) > float.Epsilon)
|
||||
{
|
||||
Projectile.velocity.X = -oldVelocity.X;
|
||||
}
|
||||
|
||||
// If the projectile hits the top or bottom side of the tile, reverse the Y velocity
|
||||
if (Math.Abs(Projectile.velocity.Y - oldVelocity.Y) > float.Epsilon)
|
||||
{
|
||||
Projectile.velocity.Y = -oldVelocity.Y;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
BIN
Content/Projectiles/MeteorHammerProjectile.png
Normal file
BIN
Content/Projectiles/MeteorHammerProjectile.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 252 B |
59
Localization/en-US_Mods.tMx.hjson
Normal file
59
Localization/en-US_Mods.tMx.hjson
Normal file
@ -0,0 +1,59 @@
|
||||
# This file will automatically update with entries for new content after a build and reload.
|
||||
|
||||
Items: {
|
||||
tMxSword: {
|
||||
DisplayName: tMx Sword
|
||||
Tooltip:
|
||||
'''
|
||||
Template of an item
|
||||
Replacing this tooltip is duty
|
||||
It's snowing on Mt.Fuji
|
||||
'''
|
||||
}
|
||||
|
||||
MeteorHammer: {
|
||||
DisplayName: Meteor Hammer
|
||||
Tooltip: ""
|
||||
}
|
||||
|
||||
ExamplePiercingProjectileItem: {
|
||||
DisplayName: Example Piercing Projectile Item
|
||||
Tooltip: ""
|
||||
}
|
||||
|
||||
MoltenTablet: {
|
||||
DisplayName: Molten Tablet
|
||||
Tooltip: You can barely hold it in your hand. It's hot!
|
||||
}
|
||||
|
||||
FrozenTablet: {
|
||||
DisplayName: Frozen Tablet
|
||||
Tooltip: You can barely hold it in your hand. It's cold!
|
||||
}
|
||||
}
|
||||
|
||||
Projectiles: {
|
||||
MeteorHammerProjectile.DisplayName: Meteor Hammer Projectile
|
||||
ExamplePiercingProjectileItem.DisplayName: Example Piercing Projectile Item
|
||||
}
|
||||
|
||||
Configs: {
|
||||
tMxConfigs: {
|
||||
DisplayName: tMx Configs
|
||||
|
||||
NoPotionDelay: {
|
||||
Label: No Potions Delay
|
||||
Tooltip: No delay between healing/mana potions use. Debuff = Off
|
||||
}
|
||||
|
||||
Headers: {
|
||||
Tweaks: Tweaks Header
|
||||
Mechanics: Mechanics Header
|
||||
}
|
||||
|
||||
CleanResearchedPiggyProtect: {
|
||||
Tooltip: The clean command will not delete item(s) in your piggy bank.
|
||||
Label: Protect item(s) from pig.
|
||||
}
|
||||
}
|
||||
}
|
98
Mechanics/CleanResearched/CleanResearchedCommand.cs
Normal file
98
Mechanics/CleanResearched/CleanResearchedCommand.cs
Normal file
@ -0,0 +1,98 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace tMx.Mechanics.CleanResearched
|
||||
{
|
||||
public class CleanResearchedCommand : ModCommand
|
||||
{
|
||||
public override CommandType Type
|
||||
=> CommandType.Chat;
|
||||
|
||||
public override string Command
|
||||
=> "tmx";
|
||||
|
||||
public override string Description
|
||||
=> "Clean all researched objects from inventory and your hotbar.";
|
||||
|
||||
public override void Action(CommandCaller caller, string input, string[] args)
|
||||
{
|
||||
tMxConfigs config = ModContent.GetInstance<tMxConfigs>();
|
||||
Player p = caller.Player;
|
||||
int pic = 0;
|
||||
|
||||
if (args.Length == 0)
|
||||
{
|
||||
Main.NewText($"[tMx] You must specify an argument.", Color.Red);
|
||||
Main.NewText($"[tMx] /tmx clean - Clean your inventory and your hotbar of any fully searched item(s).", Color.Red);
|
||||
}
|
||||
if (args.Contains("clean"))
|
||||
{
|
||||
List<int> piggy = new List<int>();
|
||||
foreach (Item i in p.bank.item)
|
||||
{
|
||||
if (i.type != ItemID.None)
|
||||
{
|
||||
piggy.Add(i.type);
|
||||
}
|
||||
}
|
||||
// Clean the inventory of any fully researched item(s)
|
||||
int ic = 0;
|
||||
for (int index = 10; index < 50; index++)
|
||||
{
|
||||
Item i = p.inventory[index];
|
||||
if (Main.LocalPlayerCreativeTracker.ItemSacrifices.TryGetSacrificeNumbers(i.type, out var amountWeHave, out var amountNeededTotal) && amountWeHave >= amountNeededTotal
|
||||
&& !i.potion
|
||||
&& !piggy.Contains(i.type))
|
||||
{
|
||||
ic++;
|
||||
p.inventory[index].TurnToAir();
|
||||
} else if (piggy.Contains(i.type) && config.CleanResearchedPiggyProtect)
|
||||
{
|
||||
pic++;
|
||||
}
|
||||
}
|
||||
Main.NewText($"[tMx] Cleaned {ic} item(s) from your inventory.", Color.Brown);
|
||||
|
||||
// Clean the hotbar of any fully researched item(s)
|
||||
int ichot = 0;
|
||||
for (int indexhot = 0; indexhot < 10; indexhot++)
|
||||
{
|
||||
Item i = p.inventory[indexhot];
|
||||
if (Main.LocalPlayerCreativeTracker.ItemSacrifices.TryGetSacrificeNumbers(i.type, out var amountWeHave, out var amountNeededTotal)
|
||||
&& amountWeHave >= amountNeededTotal
|
||||
&& !i.potion
|
||||
&& !i.GetPrefixCategories().Contains(PrefixCategory.Accessory)
|
||||
&& !i.GetPrefixCategories().Contains(PrefixCategory.AnyWeapon)
|
||||
&& i.type != ItemID.Torch
|
||||
&& i.type != ItemID.FallenStar
|
||||
&& !piggy.Contains(i.type))
|
||||
{
|
||||
ichot++;
|
||||
p.inventory[indexhot].TurnToAir();
|
||||
} else if (piggy.Contains(i.type) && config.CleanResearchedPiggyProtect)
|
||||
{
|
||||
pic++;
|
||||
}
|
||||
}
|
||||
Main.NewText($"[tMx] Cleaned {ichot} item(s) from your hotbar.", Color.Brown);
|
||||
if (pic == 1)
|
||||
{
|
||||
Main.NewText($"[tMx] {pic} item was protected for being in your piggy bank.", Color.Brown);
|
||||
} else if (pic > 1)
|
||||
{
|
||||
Main.NewText($"[tMx] {pic} items were protected for being in your piggy bank.", Color.Brown);
|
||||
}
|
||||
ic = 0;
|
||||
ichot = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
35
NPCs/CustomLoot/FrozenTabletOnKill.cs
Normal file
35
NPCs/CustomLoot/FrozenTabletOnKill.cs
Normal file
@ -0,0 +1,35 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader.IO;
|
||||
using static Terraria.GameContent.Bestiary.IL_BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions;
|
||||
using Microsoft.Xna.Framework;
|
||||
|
||||
namespace tMx.NPCs.CustomLoot
|
||||
{
|
||||
public class FrozenTabletOnKill : GlobalNPC
|
||||
{
|
||||
public override void OnKill(NPC npc)
|
||||
{
|
||||
if (Main.rand.NextBool(3)) // ~33%
|
||||
{
|
||||
if (npc.type == NPCID.IceSlime
|
||||
|| npc.type == NPCID.IceBat)
|
||||
{
|
||||
int dropItemType = ModContent.ItemType<Content.Items.Materials.FrozenTablet>();
|
||||
int newItem = Item.NewItem(npc.GetSource_FromThis(), npc.Hitbox, dropItemType);
|
||||
|
||||
if (Main.netMode == NetmodeID.MultiplayerClient && newItem >= 0)
|
||||
{
|
||||
NetMessage.SendData(MessageID.SyncItem, -1, -1, null, newItem, 1f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
37
NPCs/CustomLoot/MoltenTabletOnKill.cs
Normal file
37
NPCs/CustomLoot/MoltenTabletOnKill.cs
Normal file
@ -0,0 +1,37 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader.IO;
|
||||
using static Terraria.GameContent.Bestiary.IL_BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions;
|
||||
using Microsoft.Xna.Framework;
|
||||
|
||||
namespace tMx.NPCs.CustomLoot
|
||||
{
|
||||
public class MoltenTabletOnKill : GlobalNPC
|
||||
{
|
||||
public override void OnKill(NPC npc)
|
||||
{
|
||||
if (Main.rand.NextBool(3)) // ~33%
|
||||
{
|
||||
if (npc.type == NPCID.Hellbat
|
||||
|| npc.type == NPCID.Lavabat
|
||||
|| npc.type == NPCID.LavaSlime
|
||||
|| npc.type == NPCID.FireImp)
|
||||
{
|
||||
int dropItemType = ModContent.ItemType<Content.Items.Materials.MoltenTablet>();
|
||||
int newItem = Item.NewItem(npc.GetSource_FromThis(), npc.Hitbox, dropItemType);
|
||||
|
||||
if (Main.netMode == NetmodeID.MultiplayerClient && newItem >= 0)
|
||||
{
|
||||
NetMessage.SendData(MessageID.SyncItem, -1, -1, null, newItem, 1f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
16
Properties/launchSettings.json
Normal file
16
Properties/launchSettings.json
Normal file
@ -0,0 +1,16 @@
|
||||
{
|
||||
"profiles": {
|
||||
"Terraria": {
|
||||
"commandName": "Executable",
|
||||
"executablePath": "$(DotNetName)",
|
||||
"commandLineArgs": "$(tMLPath)",
|
||||
"workingDirectory": "$(tMLSteamPath)"
|
||||
},
|
||||
"TerrariaServer": {
|
||||
"commandName": "Executable",
|
||||
"executablePath": "$(DotNetName)",
|
||||
"commandLineArgs": "$(tMLServerPath)",
|
||||
"workingDirectory": "$(tMLSteamPath)"
|
||||
}
|
||||
}
|
||||
}
|
2
README.md
Normal file
2
README.md
Normal file
@ -0,0 +1,2 @@
|
||||
## tMx
|
||||
tMx is my official tModLoader mod containing all my modifications.
|
19
Tweaks/Potion/NoPotionDelay.cs
Normal file
19
Tweaks/Potion/NoPotionDelay.cs
Normal file
@ -0,0 +1,19 @@
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace tMx.Tweaks.Potion
|
||||
{
|
||||
public class NoPotionDelay : GlobalItem
|
||||
{
|
||||
public override void OnConsumeItem(Item item, Player player)
|
||||
{
|
||||
tMxConfigs config = ModContent.GetInstance<tMxConfigs>();
|
||||
if (item.potion && config.NoPotionDelay)
|
||||
{
|
||||
player.ClearBuff(21);
|
||||
player.potionDelay = 0;
|
||||
player.potionDelayTime = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
22
Tweaks/Potion/PotionLength.cs
Normal file
22
Tweaks/Potion/PotionLength.cs
Normal file
@ -0,0 +1,22 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria;
|
||||
|
||||
namespace tMx.Tweaks.Potion
|
||||
{
|
||||
internal class PotionLength : GlobalItem
|
||||
{
|
||||
public override void OnConsumeItem(Item item, Player player)
|
||||
{
|
||||
tMxConfigs config = ModContent.GetInstance<tMxConfigs>();
|
||||
if (item.potion)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
1
description.txt
Normal file
1
description.txt
Normal file
@ -0,0 +1 @@
|
||||
tMx Server Official Mod
|
15
tMx.cs
Normal file
15
tMx.cs
Normal file
@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace tMx
|
||||
{
|
||||
// Please read https://github.com/tModLoader/tModLoader/wiki/Basic-tModLoader-Modding-Guide#mod-skeleton-contents for more information about the various files in a mod.
|
||||
public class tMx : Mod
|
||||
{
|
||||
|
||||
}
|
||||
}
|
13
tMx.csproj
Normal file
13
tMx.csproj
Normal file
@ -0,0 +1,13 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<!-- Import tModLoader mod properties -->
|
||||
<Import Project="..\tModLoader.targets" />
|
||||
|
||||
<!-- General -->
|
||||
<PropertyGroup>
|
||||
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- References -->
|
||||
|
||||
</Project>
|
22
tMx.sln
Normal file
22
tMx.sln
Normal file
@ -0,0 +1,22 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.12.35707.178 d17.12
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "tMx", "tMx.csproj", "{3A853CE7-F5D2-49BC-AD7E-2DBD49701C8B}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{3A853CE7-F5D2-49BC-AD7E-2DBD49701C8B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{3A853CE7-F5D2-49BC-AD7E-2DBD49701C8B}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{3A853CE7-F5D2-49BC-AD7E-2DBD49701C8B}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{3A853CE7-F5D2-49BC-AD7E-2DBD49701C8B}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
24
tMxConfigs.cs
Normal file
24
tMxConfigs.cs
Normal file
@ -0,0 +1,24 @@
|
||||
using System.ComponentModel;
|
||||
using Terraria.ModLoader.Config;
|
||||
|
||||
namespace tMx
|
||||
{
|
||||
public class tMxConfigs : ModConfig
|
||||
{
|
||||
[Header("Tweaks")]
|
||||
|
||||
[Label("No Potions Delay")]
|
||||
[Tooltip("No delay between healing/mana potions use. Debuff = Off")]
|
||||
[DefaultValue(false)]
|
||||
public bool NoPotionDelay;
|
||||
|
||||
[Header("Mechanics")]
|
||||
|
||||
[Label("Protect item(s) from pig.")]
|
||||
[Tooltip("The clean command will not delete researched item(s) present in your piggy bank.")]
|
||||
[DefaultValue(false)]
|
||||
public bool CleanResearchedPiggyProtect;
|
||||
|
||||
public override ConfigScope Mode => (ConfigScope)0;
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user