working nice
This commit is contained in:
commit
49511f4109
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
bin/
|
||||
obj/
|
||||
116
Content/Items/Accessories/Spacesuit.cs
Normal file
116
Content/Items/Accessories/Spacesuit.cs
Normal file
@ -0,0 +1,116 @@
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
|
||||
namespace Emiliasmod.Content.Items.Accessories
|
||||
{
|
||||
public class Spacesuit : ModItem
|
||||
{
|
||||
|
||||
public static readonly int DefenseBonus = 8;
|
||||
|
||||
//public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs();
|
||||
|
||||
public override void SetDefaults() {
|
||||
Item.width = 40;
|
||||
Item.height = 40;
|
||||
Item.accessory = true;
|
||||
Item.rare = ItemRarityID.Red;
|
||||
Item.value = Item.sellPrice(platinum: 1, gold: 35);
|
||||
}
|
||||
|
||||
public override void AddRecipes() {
|
||||
Recipe recipe = CreateRecipe();
|
||||
recipe.AddTile(TileID.LunarMonolith);
|
||||
recipe.AddIngredient(ItemID.TerrasparkBoots, 1);
|
||||
recipe.AddIngredient(ItemID.CelestialShell, 1);
|
||||
recipe.AddIngredient(ItemID.ArcticDivingGear, 1);
|
||||
recipe.AddIngredient(ItemID.CharmofMyths, 1);
|
||||
recipe.AddIngredient(ItemID.AnkhShield, 1);
|
||||
recipe.AddCondition(Condition.DownedMoonLord);
|
||||
recipe.Register();
|
||||
}
|
||||
|
||||
public override void UpdateAccessory(Player player, bool hideVisual) {
|
||||
player.rocketBoots = 4;
|
||||
player.vanityRocketBoots = 4;
|
||||
|
||||
player.waterWalk2 = true;
|
||||
player.waterWalk = true;
|
||||
player.iceSkate = true;
|
||||
player.desertBoots = true;
|
||||
player.fireWalk = true;
|
||||
player.noFallDmg = true;
|
||||
player.lavaRose = true;
|
||||
player.lavaMax += 20 * 60;
|
||||
|
||||
player.statDefense += DefenseBonus;
|
||||
|
||||
player.arcticDivingGear = true;
|
||||
//player.wereWolf = true;
|
||||
player.accMerman = true;
|
||||
|
||||
player.buffImmune[BuffID.BrokenArmor] = true;
|
||||
player.buffImmune[BuffID.Bleeding] = true;
|
||||
player.buffImmune[BuffID.Burning] = true;
|
||||
player.buffImmune[BuffID.Chilled] = true;
|
||||
player.buffImmune[BuffID.Confused] = true;
|
||||
player.buffImmune[BuffID.Cursed] = true;
|
||||
player.buffImmune[BuffID.Darkness] = true;
|
||||
player.buffImmune[BuffID.Poisoned] = true;
|
||||
player.buffImmune[BuffID.Silenced] = true;
|
||||
player.buffImmune[BuffID.Slow] = true;
|
||||
player.buffImmune[BuffID.Stoned] = true;
|
||||
player.buffImmune[BuffID.Weak] = true;
|
||||
player.noKnockback = true;
|
||||
|
||||
player.lifeRegen += 4;
|
||||
player.PotionDelayModifier -= 0.25f;
|
||||
|
||||
player.GetDamage(DamageClass.Generic) += 10f;
|
||||
player.GetAttackSpeed(DamageClass.Generic) += 10f;
|
||||
player.GetCritChance(DamageClass.Generic) += 4f;
|
||||
player.GetKnockback(DamageClass.Summon) += 0.5f;
|
||||
player.blockRange += 1;
|
||||
player.pickSpeed -= 0.15f;
|
||||
|
||||
player.accRunSpeed = 6.75f;
|
||||
player.runAcceleration = 2.0f;
|
||||
player.moveSpeed += 0.25f;
|
||||
|
||||
if (!hideVisual) {
|
||||
player.CancelAllBootRunVisualEffects();
|
||||
}
|
||||
//if (player.)
|
||||
|
||||
player.GetModPlayer<SpacesuitStatBonusAccessoryPlayer>().SpacesuitStatBonusAccessory = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Some movement effects are not suitable to be modified in ModItem.UpdateAccessory due to how the math is done.
|
||||
// ModPlayer.PostUpdateRunSpeeds is suitable for these modifications.
|
||||
public class SpacesuitStatBonusAccessoryPlayer : ModPlayer
|
||||
{
|
||||
public bool SpacesuitStatBonusAccessory = false;
|
||||
|
||||
public override void ResetEffects() {
|
||||
SpacesuitStatBonusAccessory = false;
|
||||
}
|
||||
|
||||
public override void PostUpdateRunSpeeds() {
|
||||
//// We only want our additional changes to apply if ExampleStatBonusAccessory is equipped and not on a mount.
|
||||
//if (Player.mount.Active || !SpacesuitStatBonusAccessory) {
|
||||
// return;
|
||||
//}
|
||||
|
||||
// The following modifications are similar to Shadow Armor set bonus
|
||||
//Player.canFloatInWater = true;
|
||||
Player.runAcceleration *= 1.75f;
|
||||
Player.maxRunSpeed *= 1.15f;
|
||||
Player.accRunSpeed *= 1.15f;
|
||||
Player.runSlowdown *= 1.75f;
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
Content/Items/Accessories/Spacesuit.png
Normal file
BIN
Content/Items/Accessories/Spacesuit.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 416 B |
50
Content/Items/Accessories/Spacesurf.cs
Normal file
50
Content/Items/Accessories/Spacesurf.cs
Normal file
@ -0,0 +1,50 @@
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace Emiliasmod.Content.Items.Accessories
|
||||
{
|
||||
[AutoloadEquip(EquipType.Wings)]
|
||||
public class Spacesurf : ModItem
|
||||
{
|
||||
public override void SetStaticDefaults() {
|
||||
ArmorIDs.Wing.Sets.Stats[Item.wingSlot] = new WingStats(180, 14f, 4f, true);
|
||||
}
|
||||
|
||||
public override void SetDefaults() {
|
||||
Item.width = 22;
|
||||
Item.height = 20;
|
||||
Item.value = Item.sellPrice(platinum: 1, gold: 35);
|
||||
Item.rare = ItemRarityID.Red;
|
||||
Item.accessory = true;
|
||||
}
|
||||
|
||||
public override void VerticalWingSpeeds(Player player, ref float ascentWhenFalling, ref float ascentWhenRising,
|
||||
ref float maxCanAscendMultiplier, ref float maxAscentMultiplier, ref float constantAscend) {
|
||||
ascentWhenFalling = 1.2f; // Falling glide speed
|
||||
ascentWhenRising = 0.4f; // Rising speed
|
||||
maxCanAscendMultiplier = 1f;
|
||||
maxAscentMultiplier = 3f;
|
||||
constantAscend = 0.135f;
|
||||
}
|
||||
|
||||
public override void UpdateAccessory(Player player, bool hideVisual)
|
||||
{
|
||||
player.wingTimeMax = 100000000;
|
||||
player.moveSpeed += 0.1f;
|
||||
player.jumpSpeedBoost += 1.8f;
|
||||
player.maxFallSpeed += 0.10f;
|
||||
player.maxRunSpeed *= 1.75f;
|
||||
player.wingAccRunSpeed += 0.75f;
|
||||
}
|
||||
public override void AddRecipes() {
|
||||
Recipe recipe = CreateRecipe();
|
||||
recipe.AddCondition(Condition.DownedMoonLord);
|
||||
recipe.AddIngredient(ItemID.CelestialSigil, 1);
|
||||
recipe.AddIngredient(ItemID.MoonLordLegs, 1);
|
||||
recipe.AddIngredient(ItemID.LongRainbowTrailWings, 1);
|
||||
recipe.Register();
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
Content/Items/Accessories/Spacesurf.png
Normal file
BIN
Content/Items/Accessories/Spacesurf.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 370 B |
BIN
Content/Items/Accessories/Spacesurf_Wings.png
Normal file
BIN
Content/Items/Accessories/Spacesurf_Wings.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.0 KiB |
40
Content/Items/EmiliasWand.cs
Normal file
40
Content/Items/EmiliasWand.cs
Normal file
@ -0,0 +1,40 @@
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
|
||||
namespace Emiliasmod.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 EmiliasWand : ModItem
|
||||
{
|
||||
// The Display Name and Tooltip of this item can be edited in the 'Localization/en-US_Mods.Emiliasmod.hjson' file.
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.damage = 300;
|
||||
Item.DamageType = DamageClass.Melee;
|
||||
Item.pick = 300;
|
||||
Item.width = 40;
|
||||
Item.height = 200;
|
||||
Item.useTime = 10;
|
||||
Item.useAnimation = 10;
|
||||
Item.useStyle = ItemUseStyleID.Shoot;
|
||||
Item.knockBack = 6;
|
||||
Item.value = Item.buyPrice(platinum: 1);
|
||||
Item.rare = ItemRarityID.Red;
|
||||
//Item.UseSound = SoundID.Item1;
|
||||
Item.autoReuse = true;
|
||||
Item.useTurn = true;
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
Recipe recipe = CreateRecipe();
|
||||
recipe.AddIngredient(ItemID.DirtBlock, 10);
|
||||
recipe.AddTile(TileID.WorkBenches);
|
||||
recipe.Register();
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
Content/Items/EmiliasWand.png
Normal file
BIN
Content/Items/EmiliasWand.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 720 B |
15
Emiliasmod.cs
Normal file
15
Emiliasmod.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 Emiliasmod
|
||||
{
|
||||
// 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 Emiliasmod : Mod
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
16
Emiliasmod.csproj
Normal file
16
Emiliasmod.csproj
Normal file
@ -0,0 +1,16 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<!-- Import tModLoader mod properties -->
|
||||
<Import Project="..\tModLoader.targets" />
|
||||
|
||||
<!-- General -->
|
||||
<PropertyGroup>
|
||||
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- References -->
|
||||
<ItemGroup>
|
||||
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
24
Emiliasmod.sln
Normal file
24
Emiliasmod.sln
Normal file
@ -0,0 +1,24 @@
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.5.2.0
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Emiliasmod", "Emiliasmod.csproj", "{741ADC3D-2994-FB59-1BEE-0908CF33834F}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{741ADC3D-2994-FB59-1BEE-0908CF33834F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{741ADC3D-2994-FB59-1BEE-0908CF33834F}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{741ADC3D-2994-FB59-1BEE-0908CF33834F}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{741ADC3D-2994-FB59-1BEE-0908CF33834F}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {62AAAEF0-7CE9-4FA8-AD95-81047C2FCF75}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
18
Localization/en-US_Mods.Emiliasmod.hjson
Normal file
18
Localization/en-US_Mods.Emiliasmod.hjson
Normal file
@ -0,0 +1,18 @@
|
||||
# This file will automatically update with entries for new content after a build and reload.
|
||||
|
||||
Items: {
|
||||
EmiliasWand: {
|
||||
DisplayName: Emilias Wand
|
||||
Tooltip: Is it a Drill ? is it a Sword ? It's an Hitachi Magic Wand !! (never used ?)
|
||||
}
|
||||
|
||||
Spacesuit: {
|
||||
DisplayName: Spacesuit
|
||||
Tooltip: Are you ready for Space ?
|
||||
}
|
||||
|
||||
Spacesurf: {
|
||||
DisplayName: Spacesurf
|
||||
Tooltip: ""
|
||||
}
|
||||
}
|
||||
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)"
|
||||
}
|
||||
}
|
||||
}
|
||||
93
README.md
Normal file
93
README.md
Normal file
@ -0,0 +1,93 @@
|
||||
# Emilia's Mod
|
||||
|
||||
___
|
||||
|
||||
### 1. Environment: Space & Subworlds
|
||||
|
||||
- Subworld Library: Integrate this to handle the "Space" dimension without hitting the 163,840-tile height limit of the main world.
|
||||
|
||||
- Physics Overrides: Create a ModSceneEffect or Subworld hook to set gravity = 0f and windSpeed = 0f.
|
||||
|
||||
- Oxygen Logic: A ModPlayer timer that drains health if HasSpaceSuit == false while in the Space subworld.
|
||||
|
||||
___
|
||||
|
||||
### 2. Ship Construction & The Launch Pad
|
||||
|
||||
- The Anchor (Launch Pad): A ModTile that acts as the origin point (0,0) for your ship scan.
|
||||
|
||||
- Integrity Scan: A method to check a 50×50 (or larger) area for "Hull" tiles (Luminite bricks, etc.) and at least one "Engine" tile.
|
||||
|
||||
- Serialization: A CaptureShip() function that saves the TileType, WallType, and TileEntity data of the ship into a TagCompound.
|
||||
|
||||
- Launch Animation: * Spawn a large Projectile with the ship’s sprite.
|
||||
- Set ship tiles in the world to type = 0 (Air).
|
||||
- Apply upward velocity to the projectile and trigger the subworld transfer once it hits the "top" of the screen.
|
||||
|
||||
___
|
||||
|
||||
### 3. Pilot Mode (Top-Down Combat)
|
||||
|
||||
- The Controller: A ModTile (Pilot Seat) that toggles IsPiloting = true.
|
||||
|
||||
- Physics Hack: * In PreUpdateMovement, set Player.gravity = 0.
|
||||
|
||||
- Apply Player.velocity *= 0.95f for linear drag.
|
||||
|
||||
- Map WASD to 2D vector movement (Top-down style).
|
||||
|
||||
- Visual Masking: Use PlayerDrawLayer to hide the player sprite and draw the Ship sprite rotated toward Main.MouseWorld.
|
||||
|
||||
- Ship Systems: Implement a "Shield" variable in ModPlayer that recharges over time and absorbs damage before the player takes hits.
|
||||
|
||||
### 4. Automation & Logistics
|
||||
|
||||
- The Registry: A List<Guid> or List<Point16> in a ModSystem to track active machines (extractors, assemblers).
|
||||
|
||||
- Heartbeat Loop: Run automation logic in PostUpdateWorld every 10–20 ticks to save CPU.
|
||||
|
||||
- Push/Pull Logic: Instead of complex pipes, use a "Transferer" tile that checks for an IItemStorage (Chest or TileEntity) in the 4 cardinal directions and moves 1 item per tick.
|
||||
|
||||
- Resource Nodes: Create "Asteroid" tiles in the subworld that can only be harvested by an automated LaserDrill TileEntity.
|
||||
|
||||
### 5. Progression Flow (Post-Moon Lord)
|
||||
|
||||
- Crafting: Combine Luminite and Moon Lord drops to create the Launch Pad and Ship Engines.
|
||||
|
||||
- Assembly: Build the ship on the pad in the Main World.
|
||||
|
||||
- Exploration: Launch to the Orbit Subworld to mine "Exotic Matter" from asteroids.
|
||||
|
||||
- Automation: Use Exotic Matter to build the Star-Chart (Remote Teleporter) and auto-farms.
|
||||
|
||||
- Expansion: Use the ship's Top-Down mode to fight "Star-Beast" bosses in Deep Space.
|
||||
|
||||
### 6. Other Point
|
||||
- Navigator (move in after moonlord)
|
||||
- Physicist (move in after moonlord)
|
||||
- Martian (move in after martian invasion, but access shop after moonlord) * hint about space travel
|
||||
- Martian spaceship can drop ship part after moonlord
|
||||
- Cleanse Reforge
|
||||
- spacesuit (Terrarian upgrade + Mystical Conch + Diving gear)
|
||||
- Alien Surf (Sigil + Celestial Starboard)
|
||||
- Space Combat (Top Down Ship Control).
|
||||
|
||||
|
||||
|
||||
Items: {
|
||||
EmiliasWand: {
|
||||
DisplayName: Emilias Wand
|
||||
Tooltip:
|
||||
'''
|
||||
Is it a Drill ? is it a Sword ? It's an Hitachi Magic Wand !! (never used ?)
|
||||
'''
|
||||
}
|
||||
Spacesuit: {
|
||||
DisplayName: Spacesuit
|
||||
Tooltip:
|
||||
Are you ready for Space ?
|
||||
'''
|
||||
Beam me up !!!!
|
||||
'''
|
||||
}
|
||||
}
|
||||
3
build.txt
Normal file
3
build.txt
Normal file
@ -0,0 +1,3 @@
|
||||
displayName = Emilia's Mod
|
||||
author = EmiliaUwU
|
||||
version = 0.1
|
||||
1
description.txt
Normal file
1
description.txt
Normal file
@ -0,0 +1 @@
|
||||
Have you ever dreamed to go into space, fight space battle and Vanquish Celestial Horror Beyond our Imagination !!
|
||||
1
description_workshop.txt
Normal file
1
description_workshop.txt
Normal file
@ -0,0 +1 @@
|
||||
This description will show up on the steam page, check out https://steamcommunity.com/comment/Guide/formattinghelp.
|
||||
BIN
icon_small.png
Normal file
BIN
icon_small.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 333 B |
Loading…
x
Reference in New Issue
Block a user