Sans Mod request

QXM_Deadeye

Terrarian
I have no idea if i'm posting this in the right place.
This mod request is basically a sans mod
This mod idea makes your mana your lifeline
These items are crafted with Hardmode materials or found in chests

ITEMS
item: Ghaster Blaster
mana cost: 5
Magic Damage: 5
speed: insanely fast
functions like the sky fracture but shoots MANY low damage projectiles in a straight line that inflict a poison/poison-like debuff
Crafting: 1 sky fracture and 999 bones

item: Sans Glove
mana cost: 1
Magic Damage: 5
shoots many bone/bone-like projectiles in a straight line dealing low damage and inflicting a poison/poison-like debuff
Crafting: 1 Laser Machinegun and 999 Bones

Item: Shortcut Staff
mana cost: 10
basically the Rod of Discord but without the chaos state debuff
Crafting: 1 Rod of Discord and 999 Bones


Item: Glowing Eye
armor slot: head
Defense: 1
Max Health -9%
user uses 10 mana each time they doge an attack.
Gives a 200% chance to doge an attack as long as the user has mana
Crafting: 20 Souls of flight and 999 Bones

Item: Old Hoodie
armor slot: chest
Defense: 1
Max Health -50%
Crafting: 10 Souls of flight and 999 Bones

item: Old sweatpants
armor slot: legs
Defense: 1
Max health -40%
Crafting: 5 Souls of flight and 999 Bones

Item: pink slippers
Vanity
Crafting: 2 bunnies and one pink dye

Item: Small Ghaster Blaster
Pet Item
a small Ghaster Blaster fallows you

(optional) Item: Skeletal Music Box
plays Megalovania
Crafting: any music box and 999 bones

If your here thanks for reading this and if you make this mod a reality please send me a download link or email the file to me at [email protected].
 
Last edited:
i am now learning to make mods so i only need someone to build some sprites for me (You will be credited of course)
 
actually i am having trouble coding the projectiles and magic weapons in so anyone willing to try making this is welcome to.
 
im haveing some trouble. the mod builds correctly but when i reload mods i get this error message

Code:
Items/CustomBeamWeapon
   at Terraria.ModLoader.Mod.GetTexture(String name)
   at Terraria.ModLoader.ModLoader.GetTexture(String name)
   at Terraria.ModLoader.ModItem.AutoStaticDefaults()
   at Terraria.ModLoader.Mod.SetupContent()
   at Terraria.ModLoader.ModLoader.do_Load(Object threadContext)

this is the code of the ghaster blaster and the laser

Code:
using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ModLoader;
using Terraria.ID;
namespace DeadeyesKarma.Items
{
public class CustomBeamWeapon : ModItem
{

public override void SetStaticDefaults()
{
DisplayName.SetDefault("Ghaster Blaster");
Tooltip.SetDefault("Megolavania Intensifies");
}
public override void SetDefaults()
{
item.damage = 5; //The damage stat for the Weapon.
item.noMelee = true; //Setting to True allows the weapon sprite to stop doing damage, so only the projectile does the damge
item.noUseGraphic = false;
item.magic = true; //This defines if it does magic damage and if its effected by magic increasing Armor/Accessories.
item.channel = true; //Channel so that you can held the weapon
item.mana = 5; //How mutch mana this weapon use
item.rare = 6; //The color the title of your Weapon when hovering over it ingame
item.width = 28; //The size of the width of the hitbox in pixels.
item.height = 30; //The size of the height of the hitbox in pixels.
item.useTime = 7; //How fast the Weapon is used.
item.UseSound = SoundID.Item13; //The sound played when using your Weapon
item.useStyle = 5; //The way your Weapon will be used, 5 is the Holding Out Used for: Guns, Spellbooks, Drills, Chainsaws, Flails, Spears for example
item.shootSpeed = 4f; //This defines the projectile speed when shoot
item.useAnimation = 7; //Speed is not important here
item.shoot = mod.ProjectileType("CustomBeamProj"); //This defines what type of projectile this weapon will shoot
item.value = Item.sellPrice(0, 3, 0, 0);// How much the item is worth, in copper coins, when you sell it to a merchant. It costs 1/5th of this to buy it back from them. An easy way to remember the value is platinum, gold, silver, copper or PPGGSSCC (so this item price is 3gold)
}
}
}

Code:
using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ModLoader;
using Terraria.ID;
using Terraria.Enums;
namespace DeadeyesKarma.Projectiles
{
    public class CustomBeamProj : ModProjectile
    {
        public override void SetStaticDefaults()
        {
            DisplayName.SetDefault("GBLaser");
        }
        private Vector2 _targetPos;         //Ending position of the laser beam
        private int _charge;                //The charge level of the weapon
        private float _moveDist = 45f;       //The distance charge particle from the player center
        public override void SetDefaults()
        {
            projectile.width = 10;
            projectile.height = 10;
            projectile.friendly = true;     //this defines if the projectile is frendly
            projectile.penetrate = -1;  //this defines the projectile penetration, -1 = infinity
            projectile.tileCollide = false;   //this defines if the tile can colide with walls
            projectile.magic = true;
            projectile.hide = true;
        }
        public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
        {
            if (_charge == 100)
            {
                Vector2 unit = _targetPos - Main.player[projectile.owner].Center;
                unit.Normalize();
                DrawLaser(spriteBatch, Main.projectileTexture[projectile.type], Main.player[projectile.owner].Center, unit, 5, projectile.damage, -1.57f, 1f, 1000f, Color.White, 45);// this is the projectile sprite draw, 45 = the distance of where the projectile starts from the player
            }
            return false;
        }
        /// <summary>
        /// The core function of drawing a laser
        /// </summary>
        public void DrawLaser(SpriteBatch spriteBatch, Texture2D texture, Vector2 start, Vector2 unit, float step, int damage, float rotation = 0f, float scale = 1f, float maxDist = 2000f, Color color = default(Color), int transDist = 50)
        {
            Vector2 origin = start;
            float r = unit.ToRotation() + rotation;
            #region Draw laser body
            for (float i = transDist; i <= _moveDist; i += step)
            {
                Color c = Color.White;
                origin = start + i * unit;
                spriteBatch.Draw(texture, origin - Main.screenPosition,
                    new Rectangle(0, 26, 28, 26), i < transDist ? Color.Transparent : c, r,
                    new Vector2(28 / 2, 26 / 2), scale, 0, 0);
            }
            #endregion
            #region Draw laser tail
            spriteBatch.Draw(texture, start + unit * (transDist - step) - Main.screenPosition,
                new Rectangle(0, 0, 28, 26), Color.White, r, new Vector2(28 / 2, 26 / 2), scale, 0, 0);
            #endregion
            #region Draw laser head
            spriteBatch.Draw(texture, start + (_moveDist + step) * unit - Main.screenPosition,
                new Rectangle(0, 52, 28, 26), Color.White, r, new Vector2(28 / 2, 26 / 2), scale, 0, 0);
            #endregion
        }
        /// <summary>
        /// Change the way of collision check of the projectile
        /// </summary>
        public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox)
        {
            if (_charge == 100)
            {
                Player p = Main.player[projectile.owner];
                Vector2 unit = (Main.player[projectile.owner].Center - _targetPos);
                unit.Normalize();
                float point = 0f;
                if (Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), p.Center - 95f * unit, p.Center - unit * _moveDist, 22, ref point))
                {
                    return true;
                }
            }
            return false;
        }
        /// <summary>
        /// Change the behavior after hit a NPC
        /// </summary>
        public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
        {
            target.immune[projectile.owner] = 5;
        }
        /// <summary>
        /// The AI of the projectile
        /// </summary>
        public override void AI()
        {
            Vector2 mousePos = Main.MouseWorld;
            Player player = Main.player[projectile.owner];
            #region Set projectile position
            if (projectile.owner == Main.myPlayer) // Multiplayer support
            {
                Vector2 diff = mousePos - player.Center;
                diff.Normalize();
                projectile.position = player.Center + diff * _moveDist;
                projectile.timeLeft = 2;
                int dir = projectile.position.X > player.position.X ? 1 : -1;
                player.ChangeDir(dir);
                player.heldProj = projectile.whoAmI;
                player.itemTime = 2;
                player.itemAnimation = 2;
                player.itemRotation = (float)Math.Atan2(diff.Y * dir, diff.X * dir);
                projectile.soundDelay--;
                #endregion
            }
            #region Charging process
            // Kill the projectile if the player stops channeling
            if (!player.channel)
            {
                projectile.Kill();
            }
            else
            {
                if (Main.time % 10 < 1 && !player.CheckMana(player.inventory[player.selectedItem].mana, true))
                {
                    projectile.Kill();
                }
                Vector2 offset = mousePos - player.Center;
                offset.Normalize();
                offset *= _moveDist - 20;
                Vector2 dustPos = player.Center + offset - new Vector2(10, 10);
                if (_charge < 100)
                {
                    _charge++;
                }
                int chargeFact = _charge / 20;
                Vector2 dustVelocity = Vector2.UnitX * 18f;
                dustVelocity = dustVelocity.RotatedBy(projectile.rotation - 1.57f, default(Vector2));
                Vector2 spawnPos = projectile.Center + dustVelocity;
                for (int k = 0; k < chargeFact + 1; k++)
                {
                    Vector2 spawn = spawnPos + ((float)Main.rand.NextDouble() * 6.28f).ToRotationVector2() * (12f - (chargeFact * 2));
                    Dust dust = Main.dust[Dust.NewDust(dustPos, 30, 30, 235, projectile.velocity.X / 2f,    //this 30, 30 is the dust weight and height 235 is the tail dust   
                        projectile.velocity.Y / 2f, 0, default(Color), 1f)];
                    dust.velocity = Vector2.Normalize(spawnPos - spawn) * 1.5f * (10f - chargeFact * 2f) / 10f;
                    dust.noGravity = true;
                    dust.scale = Main.rand.Next(10, 20) * 0.05f;
                }
            }
            #endregion
            #region Set laser tail position and dusts
            if (_charge < 100) return;
            Vector2 start = player.Center;
            Vector2 unit = (player.Center - mousePos);
            unit.Normalize();
            unit *= -1;
            for (_moveDist = 95f; _moveDist <= 1600; _moveDist += 5) //this 1600 is the dsitance of the beam
            {
                start = player.Center + unit * _moveDist;
                if (!Collision.CanHit(player.Center, 1, 1, start, 1, 1))
                {
                    _moveDist -= 5f;
                    break;
                }
                if (projectile.soundDelay <= 0)//this is the proper sound delay for this type of weapon
                {
                    Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 15);    //this is the sound when the weapon is used   cheange 15 for diferent sound
                    projectile.soundDelay = 40;    //this is the proper sound delay for this type of weapon
                }
            }
            _targetPos = player.Center + unit * _moveDist;
            //dust
            for (int i = 0; i < 2; ++i)
            {
                float num1 = projectile.velocity.ToRotation() + (Main.rand.Next(2) == 1 ? -1.0f : 1.0f) * 1.57f;
                float num2 = (float)(Main.rand.NextDouble() * 0.8f + 1.0f);
                Vector2 dustVel = new Vector2((float)Math.Cos(num1) * num2, (float)Math.Sin(num1) * num2);
                Dust dust = Main.dust[Dust.NewDust(_targetPos, 0, 0, 235, dustVel.X, dustVel.Y, 0, new Color(), 1f)];  //this is the head dust
                Dust dust2 = Main.dust[Dust.NewDust(_targetPos, 0, 0, 235, dustVel.X, dustVel.Y, 0, new Color(), 1f)]; //this is the head dust 2
                dust.noGravity = true;
                dust.scale = 1.2f;
            }
        
            #endregion
        }
        public override bool ShouldUpdatePosition()
        {
            return false;
        }
      
    }
}

i don't get what the error says thanks in advance.
 
Back
Top Bottom