using System;
using System.Collections.Generic;
using System.IO;
using UnityEngine;
using UnityEngine.Events;

namespace GreenBrickLite
{
    public class GreenBrickLite
    {
        public static void Main()
        {
                                             //what are you doing Here?  Nevermind 
            //Scissors
            ModAPI.Register(
                new Modification()
                {
                    OriginalItem = ModAPI.FindSpawnable("Knife"), 
                    NameOverride = "Scissors -RW", // Name.
                    NameToOrderByOverride = "AA1", //  
                    DescriptionOverride = "Go Brrrr",// Description
                    CategoryOverride = ModAPI.FindCategory("Melee"),//Category
                    ThumbnailOverride = ModAPI.LoadSprite("ScissorsView.png", 5f),//Thumbnail
                    AfterSpawn = (Instance) =>
                    {
                        Instance.GetComponent<SpriteRenderer>().sprite = ModAPI.LoadSprite("Scissors.png", 1f);
                        Instance.FixColliders();

                    }
                }
            );

 //Kitchen Knife
            ModAPI.Register(
                new Modification()
                {
                    OriginalItem = ModAPI.FindSpawnable("Knife"), 
                    NameOverride = "Kitchen Knife -RW", // Name.
                    NameToOrderByOverride = "AA1", //  
                    DescriptionOverride = "Sharp Knife",// Description
                    CategoryOverride = ModAPI.FindCategory("Melee"),//Category
                    ThumbnailOverride = ModAPI.LoadSprite("KitchenKnifeView.png", 5f),//Thumbnail
                    AfterSpawn = (Instance) =>
                    {
                        Instance.GetComponent<SpriteRenderer>().sprite = ModAPI.LoadSprite("KitchenKnife.png", 1.2f);
                        Instance.FixColliders();

                    }
                }
            );

            ModAPI.Register(
                new Modification()
                {
                    OriginalItem = ModAPI.FindSpawnable("Sword"), 
                    NameOverride = "Nail -RW", // Name.
                    NameToOrderByOverride = "AA1", //  
                    DescriptionOverride = "Nailed It",// Description
                    CategoryOverride = ModAPI.FindCategory("Melee"),//Category
                    ThumbnailOverride = ModAPI.LoadSprite("NailView.png", 5f),//Thumbnail
                    AfterSpawn = (Instance) =>
                    {
                        Instance.GetComponent<SpriteRenderer>().sprite = ModAPI.LoadSprite("Nail.png", 1.3f);
                        Instance.FixColliders();

                    }
                }
            );
//Shuriken
            ModAPI.Register(
                new Modification()
                {
                    OriginalItem = ModAPI.FindSpawnable("Crystal"), 
                    NameOverride = "Shuriken -RW", // Name.
                    NameToOrderByOverride = "AA1", //  
                    DescriptionOverride = "Ninja!",// Description
                    CategoryOverride = ModAPI.FindCategory("Melee"),//Category
                    ThumbnailOverride = ModAPI.LoadSprite("ShurikenView.png", 5f),//Thumbnail
                    AfterSpawn = (Instance) =>
                    {
                        Instance.GetComponent<SpriteRenderer>().sprite = ModAPI.LoadSprite("Shuriken.png", 1.4f);
                        Instance.FixColliders();

                    }
                }
            );
//ScrewDriver
            ModAPI.Register(
                new Modification()
                {
                    OriginalItem = ModAPI.FindSpawnable("Crossbow Bolt"), 
                    NameOverride = "Screwdriver -RW", // Name.
                    NameToOrderByOverride = "AA1", //  
                    DescriptionOverride = "Screw This Mod",// Description
                    CategoryOverride = ModAPI.FindCategory("Melee"),//Category
                    ThumbnailOverride = ModAPI.LoadSprite("ScrewdriverView.png", 5f),//Thumbnail
                    AfterSpawn = (Instance) =>
                    {
                        Instance.GetComponent<SpriteRenderer>().sprite = ModAPI.LoadSprite("Screwdriver.png", 1f);
                        Instance.FixColliders();

                    }
                }
            );

//Hand Clasp
            ModAPI.Register(
                new Modification()
                {
                    OriginalItem = ModAPI.FindSpawnable("Knife"), 
                    NameOverride = "Hand Clasp -RW", // Name.
                    NameToOrderByOverride = "AA1", //  
                    DescriptionOverride = "Beat em up",// Description
                    CategoryOverride = ModAPI.FindCategory("Melee"),//Category
                    ThumbnailOverride = ModAPI.LoadSprite("HandClaspView.png", 5f),//Thumbnail
                    AfterSpawn = (Instance) =>
                    {
                        Instance.GetComponent<SpriteRenderer>().sprite = ModAPI.LoadSprite("HandClasp.png", 1.1f);
                        Instance.FixColliders();

                    }
                }
            );

//PitchFork
            ModAPI.Register(
                new Modification()
                {
                    OriginalItem = ModAPI.FindSpawnable("Sword"), 
                    NameOverride = "PitchFork -RW", // Name.
                    NameToOrderByOverride = "AA1", //  
                    DescriptionOverride = "Kill the frnakenstein!",// Description
                    CategoryOverride = ModAPI.FindCategory("Melee"),//Category
                    ThumbnailOverride = ModAPI.LoadSprite("PitchForkView.png", 5f),//Thumbnail
                    AfterSpawn = (Instance) =>
                    {
                        Instance.GetComponent<SpriteRenderer>().sprite = ModAPI.LoadSprite("PitchFork.png", 0.8f);
                        Instance.FixColliders();

                    }
                }
            );

//Fork
            ModAPI.Register(
                new Modification()
                {
                    OriginalItem = ModAPI.FindSpawnable("Crossbow Bolt"), 
                    NameOverride = "Fork -RW", // Name.
                    NameToOrderByOverride = "AA1", //  
                    DescriptionOverride = "Eat.. or not?",// Description
                    CategoryOverride = ModAPI.FindCategory("Melee"),//Category
                    ThumbnailOverride = ModAPI.LoadSprite("ForkView.png", 5f),//Thumbnail
                    AfterSpawn = (Instance) =>
                    {
                        Instance.GetComponent<SpriteRenderer>().sprite = ModAPI.LoadSprite("Fork.png", 1.3f);
                        Instance.FixColliders();

                    }
                }
            );

//Pipe
            ModAPI.Register(
                new Modification()
                {
                    OriginalItem = ModAPI.FindSpawnable("Rod"), 
                    NameOverride = "Pipe -RW", // Name.
                    NameToOrderByOverride = "AA1", //  
                    DescriptionOverride = "Yes you need to use pipe",// Description
                    CategoryOverride = ModAPI.FindCategory("Melee"),//Category
                    ThumbnailOverride = ModAPI.LoadSprite("PipeView.png", 5f),//Thumbnail
                    AfterSpawn = (Instance) =>
                    {
                        Instance.GetComponent<SpriteRenderer>().sprite = ModAPI.LoadSprite("Pipe.png", 1f);
                        Instance.FixColliders();
                        Instance.GetComponent<PhysicalBehaviour>().InitialMass = 8f;
                        Instance.GetComponent<PhysicalBehaviour>().TrueInitialMass = 0.1f;

                    }
                }
            );

//SledgeHammer
            ModAPI.Register(
                new Modification()
                {
                    OriginalItem = ModAPI.FindSpawnable("Rod"), 
                    NameOverride = "SledgeHammer -RW", // Name.
                    NameToOrderByOverride = "AA1", //  
                    DescriptionOverride = "Epic destruction",// Description
                    CategoryOverride = ModAPI.FindCategory("Melee"),//Category
                    ThumbnailOverride = ModAPI.LoadSprite("SledgeHammerView.png", 5f),//Thumbnail
                    AfterSpawn = (Instance) =>
                    {
                        Instance.GetComponent<SpriteRenderer>().sprite = ModAPI.LoadSprite("SledgeHammer.png", 0.9f);
                        Instance.FixColliders();
                        Instance.GetComponent<PhysicalBehaviour>().InitialMass = 11f;
                        Instance.GetComponent<PhysicalBehaviour>().TrueInitialMass = 0.2f;

                    }
                }
            );

//GolfClub
            ModAPI.Register(
                new Modification()
                {
                    OriginalItem = ModAPI.FindSpawnable("Stick"), 
                    NameOverride = "Golf Club -RW", // Name.
                    NameToOrderByOverride = "AA1", //  
                    DescriptionOverride = "Also can be a hockey Stick",// Description
                    CategoryOverride = ModAPI.FindCategory("Melee"),//Category
                    ThumbnailOverride = ModAPI.LoadSprite("GolfClubView.png", 5f),//Thumbnail
                    AfterSpawn = (Instance) =>
                    {
                        Instance.GetComponent<SpriteRenderer>().sprite = ModAPI.LoadSprite("GolfClub.png", 0.9f);
                        Instance.FixColliders();
                        Instance.GetComponent<PhysicalBehaviour>().InitialMass = 9f;
                        Instance.GetComponent<PhysicalBehaviour>().TrueInitialMass = 0.2f;

                    }
                }
            );

//Police Baton
            ModAPI.Register(
                new Modification()
                {
                    OriginalItem = ModAPI.FindSpawnable("Stick"), 
                    NameOverride = "Police Baton -RW", // Name.
                    NameToOrderByOverride = "AA1", //  
                    DescriptionOverride = "You are under arrest.",// Description
                    CategoryOverride = ModAPI.FindCategory("Melee"),//Category
                    ThumbnailOverride = ModAPI.LoadSprite("PoliceBatonView.png", 5f),//Thumbnail
                    AfterSpawn = (Instance) =>
                    {
                        Instance.GetComponent<SpriteRenderer>().sprite = ModAPI.LoadSprite("PoliceBaton.png", 1f);
                        Instance.FixColliders();
                        Instance.GetComponent<PhysicalBehaviour>().InitialMass = 7f;
                        Instance.GetComponent<PhysicalBehaviour>().TrueInitialMass = 0.1f;

                    }
                }
            );

//Hammer
            ModAPI.Register(
                new Modification()
                {
                    OriginalItem = ModAPI.FindSpawnable("Rod"), 
                    NameOverride = "Hammer -RW", // Name.
                    NameToOrderByOverride = "AA1", //  
                    DescriptionOverride = "Hammer time",// Description
                    CategoryOverride = ModAPI.FindCategory("Melee"),//Category
                    ThumbnailOverride = ModAPI.LoadSprite("HammerView.png", 5f),//Thumbnail
                    AfterSpawn = (Instance) =>
                    {
                        Instance.GetComponent<SpriteRenderer>().sprite = ModAPI.LoadSprite("Hammer.png", 1f);
                        Instance.FixColliders();
                        Instance.GetComponent<PhysicalBehaviour>().InitialMass = 6f;
                        Instance.GetComponent<PhysicalBehaviour>().TrueInitialMass = 0.1f;

                    }
                }
            );

//DumbBell
            ModAPI.Register(
                new Modification()
                {
                    OriginalItem = ModAPI.FindSpawnable("Rod"), 
                    NameOverride = "DumbBell -RW", // Name.
                    NameToOrderByOverride = "AA1", //  
                    DescriptionOverride = "Even Humans in people playground should have muscles",// Description
                    CategoryOverride = ModAPI.FindCategory("Melee"),//Category
                    ThumbnailOverride = ModAPI.LoadSprite("dumbbellView.png", 5f),//Thumbnail
                    AfterSpawn = (Instance) =>
                    {
                        Instance.GetComponent<SpriteRenderer>().sprite = ModAPI.LoadSprite("dumbbell.png", 1f);
                        Instance.FixColliders();
                        Instance.GetComponent<PhysicalBehaviour>().InitialMass = 8f;
                        Instance.GetComponent<PhysicalBehaviour>().TrueInitialMass = 0.2f;

                    }
                }
            );

//BoxingGlove
            ModAPI.Register(
                new Modification()
                {
                    OriginalItem = ModAPI.FindSpawnable("Brick"), 
                    NameOverride = "Boxing Glove -RW", // Name.
                    NameToOrderByOverride = "AA1", //  
                    DescriptionOverride = "Box Box Box?!",// Description
                    CategoryOverride = ModAPI.FindCategory("Melee"),//Category
                    ThumbnailOverride = ModAPI.LoadSprite("BoxingGloveView.png", 5f),//Thumbnail
                    AfterSpawn = (Instance) =>
                    {
                        Instance.GetComponent<SpriteRenderer>().sortingLayerName = "Top";
                        Instance.GetComponent<SpriteRenderer>().sprite = ModAPI.LoadSprite("BoxingGlove.png", 1f);
                        Instance.FixColliders();
                        Instance.GetComponent<PhysicalBehaviour>().InitialMass = 4f;
                        Instance.GetComponent<PhysicalBehaviour>().TrueInitialMass = 0.2f;

                    }
                }
            );

        }
    }
}