EtG Modding Guide
  • ETG Modding Guide
  • Getting started
    • Modding EtG: Installing Mods
    • Modding EtG: Creating a Mod
    • Uploading a Mod
    • Useful Tools
      • Using IlSpy
  • Making An Item
    • Creating A Passive
    • Creating An Active
    • Creating An Ammolet
    • Creating A Guon
    • Synergies
  • Making a Gun
    • Creating A Gun
      • Setting Up Gun Sprite Folders
      • Creating Gun Jsons/Jtk2ds
        • Pixel Measurement Conversions
    • Setting Up Projectiles
      • Adding Components To A Projectile
      • Projectile HitEffects (Visual Effects)
      • Adding status effects to a projectile
    • Continuous Fire Animations
    • Gun Ammo Types
  • Custom Characters
    • Creating A Standalone Custom Character
  • Making a Floor
    • Introduction
    • Setup
    • Making The Dungeon
    • Tileset
    • Rooms
    • Making the flow
    • Making the Entrance
    • All Files
  • Text, Text Boxes, Etc
    • Textboxes
    • Text Formatting
  • Sounds
    • Using Custom Sounds
    • Customising Gun Sounds
    • Basegame Sound List
    • wwise Sound Dump
  • Misc
    • Making Asset bundles
    • Assetbundles: How-To
    • How to create a hook
    • Creating A Command
    • Subscribing Methods to Actions
    • Reversing Player Controls
    • Undodgeable Projectiles
    • Creating An Enemy
  • Shaders
    • Creating Shaders
  • All things Spriting
    • Important Sprite Creation Information.
    • Importing a Sprite To Visual Studios
  • Monobehaviour Documentation
    • BounceProjModifier
    • PierceProjModifier
    • KeyProjModifier
    • CompanionFollowPlayerBehaviour
  • Various Lists of IDs, Sounds, Etc.
    • List of Item and Gun IDs
    • Enemy Guids
    • List of Base Game Synergies
    • dfSpriteList
    • All Custom Ammo Types
    • Gun .Json Dump
  • OFF TOPIC MEMES
    • Modders Anthem
Powered by GitBook
On this page

Was this helpful?

  1. Making An Item

Creating An Ammolet

PreviousCreating An ActiveNextCreating A Guon

Last updated 3 years ago

Was this helpful?

Difficulty: 1/10

This tutorial will use code and terms explained in passives, so it is advised to check that out before making an Ammolet.

First, you will need this class somewhere in your project :

using System;
using MonoMod.RuntimeDetour;
using System.Reflection;
using UnityEngine;

namespace YourNameSpace
{
    class SpecialBlankModificationItem : BlankModificationItem
    {
        public static void InitHooks()
        {
            Hook hook = new Hook(
                typeof(SilencerInstance).GetMethod("ProcessBlankModificationItemAdditionalEffects", BindingFlags.NonPublic | BindingFlags.Instance),
                typeof(SpecialBlankModificationItem).GetMethod("BlankModificationHook")
            );
        }

        public static void BlankModificationHook(Action<SilencerInstance, BlankModificationItem, Vector2, PlayerController> orig, SilencerInstance self, BlankModificationItem bmi, Vector2 centerPoint, PlayerController user)
        {
            orig(self, bmi, centerPoint, user);
            if (bmi is SpecialBlankModificationItem)
            {
                (bmi as SpecialBlankModificationItem).OnBlank(self, centerPoint, user);
            }
        }

        protected virtual void OnBlank(SilencerInstance silencerInstance, Vector2 centerPoint, PlayerController user)
        {

        }
    }
}

Put this in your ETGModule class.

            SpecialBlankModificationItem.InitHooks();
            

Then, you want to create a new item and make it inherit from SpecialBlankModificationItem. Then, you want to be using ItemAPI and UnityEngine.

using System;
using ItemAPI;
using UnityEngine;

namespace YourNameSpace
{
    class YourClassName : SpecialBlankModificationItem
    {
        public static void Init()
        {
        
            //Same set up as passive items
            //...
            
            //you'll need this to make your ammolet give an aditionnal like vanilla ammolets
            ItemBuilder.AddPassiveStatModifier(item, PlayerStats.StatType.AdditionalBlanksPerFloor, 1, StatModifier.ModifyMethod.ADDITIVE);

        }
    }
}

Finally, put a method OnBlank in your item class and put your effect inside it so it's triggered when the user create a blank effect with an item or a blank :

protected override void OnBlank(SilencerInstance silencerInstance, Vector2 centerPoint, PlayerController user)
{
    //put your effect in here
    
    //for example, make blanks deal no dmg
    silencerInstance.ForceNoDamage = true;

}

[TODO]