Пример #1
0
        // Token: 0x06000059 RID: 89 RVA: 0x0000480C File Offset: 0x00002A0C
        public static void Add()
        {
            ShrineFactory ShrineFactory = new ShrineFactory
            {
                name                  = "Shrine Of The Whisper",
                modID                 = "BunnyMod",
                spritePath            = "BunnyMod/Resources/ShrineOfWhisper/ancientwhisper_idle_001.png",
                shadowSpritePath      = "BunnyMod/Resources/ShrineOfWhisper/ancientwhispershadow_001",
                acceptText            = "I challenge the Shrine Of The Whisper. (Lag Warning)",
                declineText           = "I don't challenge the Shrine Of The Whisper.",
                OnAccept              = new Action <PlayerController, GameObject>(WhisperShrine.Accept),
                OnDecline             = null,
                CanUse                = new Func <PlayerController, GameObject, bool>(WhisperShrine.CanUse),
                offset                = new Vector3(103.9375f, 15.5f, 16f),
                talkPointOffset       = new Vector3(3f, 3f, 0f),
                isToggle              = false,
                isBreachShrine        = true,
                interactableComponent = typeof(WhisperShrineInteractible)
            };
            GameObject gameObject = ShrineFactory.Build();

            gameObject.AddAnimation("idle", "BunnyMod/Resources/ShrineOfWhisper/", 2, NPCBuilder.AnimationType.Idle, DirectionalAnimation.DirectionType.None, DirectionalAnimation.FlipType.None);
            gameObject.AddAnimation("talk", "BunnyMod/Resources/ShrineOfWhisper/", 6, NPCBuilder.AnimationType.Talk, DirectionalAnimation.DirectionType.None, DirectionalAnimation.FlipType.None);
            gameObject.AddAnimation("talk_start", "BunnyMod/Resources/ShrineOfWhisper/", 6, NPCBuilder.AnimationType.Other, DirectionalAnimation.DirectionType.None, DirectionalAnimation.FlipType.None);
            gameObject.AddAnimation("do_effect", "BunnyMod/Resources/ShrineOfWhisper/", 5, NPCBuilder.AnimationType.Other, DirectionalAnimation.DirectionType.None, DirectionalAnimation.FlipType.None);
            WhisperShrineInteractible component = gameObject.GetComponent <WhisperShrineInteractible>();

            component.conversation = new List <string>
            {
                "Challenge the Shrine Of The Whisper?"
            };
            gameObject.SetActive(false);
        }
Пример #2
0
        public static void Add()
        {
            OldShrineFactory shrineFactory = new OldShrineFactory
            {
                name       = "Carto",
                modID      = "omitb",
                spritePath = "NevernamedsItems/Resources/NPCSprites/Carto/carto_idle_001.png",
                //shadowSpritePath = "NevernamedsItems/Resources/NPCSprites/Carto/carto_shadow_001.png",
                room                  = RoomFactory.BuildFromResource("NevernamedsItems/Resources/EmbeddedRooms/InvestmentShrineRoom.room").room,
                OnAccept              = new Action <PlayerController, GameObject>(Carto.Accept),
                OnDecline             = null,
                CanUse                = new Func <PlayerController, GameObject, bool>(Carto.CanUse),
                talkPointOffset       = new Vector3(2.31f, 1.0f, 0f),
                isToggle              = false,
                isBreachShrine        = false,
                interactableComponent = typeof(CartoInteractible)
            };
            GameObject gameObject = shrineFactory.Build();

            gameObject.AddAnimation("idle", "NevernamedsItems/Resources/NPCSprites/Carto/carto_idle", 12, NPCBuilder.AnimationType.Idle, DirectionalAnimation.DirectionType.None, DirectionalAnimation.FlipType.None);
            gameObject.AddAnimation("talk", "NevernamedsItems/Resources/NPCSprites/Carto/carto_talk", 12, NPCBuilder.AnimationType.Talk, DirectionalAnimation.DirectionType.None, DirectionalAnimation.FlipType.None);
            gameObject.AddAnimation("talk_start", "NevernamedsItems/Resources/NPCSprites/Carto/carto_talk", 12, NPCBuilder.AnimationType.Other, DirectionalAnimation.DirectionType.None, DirectionalAnimation.FlipType.None);
            gameObject.AddAnimation("do_effect", "NevernamedsItems/Resources/NPCSprites/Carto/carto_talk", 12, NPCBuilder.AnimationType.Other, DirectionalAnimation.DirectionType.None, DirectionalAnimation.FlipType.None);
            CartoInteractible component = gameObject.GetComponent <CartoInteractible>();

            gameObject.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(gameObject.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(gameObject);
            CartoPrefab = gameObject;
        }
Пример #3
0
 public static void BuildDenkSnavelPrefab()
 {
     if (prefab == null || !CompanionBuilder.companionDictionary.ContainsKey(guid))
     {
         prefab = CompanionBuilder.BuildPrefab("Gumgun Denksnavel", guid, "NevernamedsItems/Resources/Companions/Denksnavel/denksnavel_idle_left_001", new IntVector2(5, 0), new IntVector2(5, 13));
         var companionController = prefab.AddComponent <DenksnavelController>();
         companionController.aiActor.MovementSpeed     = 6.5f;
         companionController.CanCrossPits              = true;
         companionController.aiActor.ActorShadowOffset = new Vector3(0, -0.5f);
         prefab.AddAnimation("idle_right", "NevernamedsItems/Resources/Companions/Denksnavel/denksnavel_idle_right", 12, CompanionBuilder.AnimationType.Idle, DirectionalAnimation.DirectionType.TwoWayHorizontal, DirectionalAnimation.FlipType.None);
         prefab.AddAnimation("idle_left", "NevernamedsItems/Resources/Companions/Denksnavel/denksnavel_idle_left", 12, CompanionBuilder.AnimationType.Idle, DirectionalAnimation.DirectionType.TwoWayHorizontal, DirectionalAnimation.FlipType.None);
         companionController.aiAnimator.GetDirectionalAnimation("idle").Prefix = "idle";
         BehaviorSpeculator component = prefab.GetComponent <BehaviorSpeculator>();
         CustomCompanionBehaviours.SimpleCompanionMeleeAttack denksnavelattack = new CustomCompanionBehaviours.SimpleCompanionMeleeAttack();
         denksnavelattack.DamagePerTick   = 5;
         denksnavelattack.DesiredDistance = 2;
         denksnavelattack.TickDelay       = 1;
         CustomCompanionBehaviours.SimpleCompanionApproach denksnavelapproach = new CustomCompanionBehaviours.SimpleCompanionApproach();
         denksnavelapproach.DesiredDistance = 1;
         component.MovementBehaviors.Add(denksnavelapproach);
         component.AttackBehaviors.Add(denksnavelattack);
         component.MovementBehaviors.Add(new CompanionFollowPlayerBehavior {
             IdleAnimations = new string[] { "idle" }
         });
     }
 }
Пример #4
0
        // Token: 0x06000059 RID: 89 RVA: 0x0000480C File Offset: 0x00002A0C
        public static void Add()
        {
            ShrineFactory ShrineFactory = new ShrineFactory
            {
                name                  = "Deicide Shrine",
                modID                 = "BunnyMod",
                spritePath            = "BunnyMod/Resources/DeicideShrine/dcdshrine_idle_001.png",
                shadowSpritePath      = "BunnyMod/Resources/DeicideShrine/dcdshrine_shadow.png",
                acceptText            = "I challenge fate. (Gives all artifacts)",
                declineText           = "I don't challenge fate.",
                OnAccept              = new Action <PlayerController, GameObject>(DeicideShrine.Accept),
                OnDecline             = null,
                CanUse                = new Func <PlayerController, GameObject, bool>(DeicideShrine.CanUse),
                offset                = new Vector3(12.6875f, 21.9375f, 22.4375f),
                talkPointOffset       = new Vector3(3f, 3f, 0f),
                isToggle              = false,
                isBreachShrine        = true,
                interactableComponent = typeof(DeicideShrineInteractible)
            };
            GameObject gameObject = ShrineFactory.Build();

            gameObject.AddAnimation("idle", "BunnyMod/Resources/DeicideShrine/", 2, NPCBuilder.AnimationType.Idle, DirectionalAnimation.DirectionType.None, DirectionalAnimation.FlipType.None);
            gameObject.AddAnimation("talk", "BunnyMod/Resources/DeicideShrine/", 3, NPCBuilder.AnimationType.Talk, DirectionalAnimation.DirectionType.None, DirectionalAnimation.FlipType.None);
            gameObject.AddAnimation("talk_start", "BunnyMod/Resources/DeicideShrine/", 4, NPCBuilder.AnimationType.Other, DirectionalAnimation.DirectionType.None, DirectionalAnimation.FlipType.None);
            gameObject.AddAnimation("do_effect", "BunnyMod/Resources/DeicideShrine/", 5, NPCBuilder.AnimationType.Other, DirectionalAnimation.DirectionType.None, DirectionalAnimation.FlipType.None);
            DeicideShrineInteractible component = gameObject.GetComponent <DeicideShrineInteractible>();

            component.conversation = new List <string>
            {
                "Put yourself to the ultimate test?"
            };
            gameObject.SetActive(false);
        }
Пример #5
0
        public static void BuildPrefab()
        {
            if (prefab != null || CompanionBuilder.companionDictionary.ContainsKey(guid))
            {
                return;
            }

            prefab = CompanionBuilder.BuildPrefab("Big Slime", guid, "CustomItems/Resources/P3/MySon/Idle/son_idle_001", new IntVector2(1, 0), new IntVector2(9, 9));

            var companion = prefab.AddComponent <CompanionController>();

            companion.aiActor.MovementSpeed = 5f;

            prefab.AddAnimation("idle_right", "CustomItems/Resources/P3/MySon/Idle", fps: 5, AnimationType.Idle, DirectionType.TwoWayHorizontal);
            prefab.AddAnimation("idle_left", "CustomItems/Resources/P3/MySon/Idle", fps: 5, AnimationType.Idle, DirectionType.TwoWayHorizontal);
            prefab.AddAnimation("run_right", "CustomItems/Resources/P3/MySon/MoveRight", fps: 7, AnimationType.Move, DirectionType.TwoWayHorizontal);
            prefab.AddAnimation("run_left", "CustomItems/Resources/P3/MySon/MoveLeft", fps: 7, AnimationType.Move, DirectionType.TwoWayHorizontal);

            var bs = prefab.GetComponent <BehaviorSpeculator>();

            bs.MovementBehaviors.Add(new CompanionFollowPlayerBehavior()
            {
                IdleAnimations = new string[] { "idle" }
            });
        }
Пример #6
0
        public static void BuildPrefab()
        {
            if (prefab != null || CompanionBuilder.companionDictionary.ContainsKey(guid))
            {
                return;
            }

            //Create the prefab with a starting sprite and hitbox offset/size
            prefab = CompanionBuilder.BuildPrefab("Big Slime", guid, "ItemAPI/Resources/BigSlime/Idle/son_idle_001", new IntVector2(1, 0), new IntVector2(9, 9));

            //Add a companion component to the prefab (could be a custom class)
            var companion = prefab.AddComponent <CompanionController>();

            companion.aiActor.MovementSpeed = 5f;

            //Add all of the needed animations (most of the animations need to have specific names to be recognized, like idle_right or attack_left)
            prefab.AddAnimation("idle_right", "ItemAPI/Resources/BigSlime/Idle", fps: 5, AnimationType.Idle, DirectionType.TwoWayHorizontal);
            prefab.AddAnimation("idle_left", "ItemAPI/Resources/BigSlime/Idle", fps: 5, AnimationType.Idle, DirectionType.TwoWayHorizontal);
            prefab.AddAnimation("run_right", "ItemAPI/Resources/BigSlime/MoveRight", fps: 7, AnimationType.Move, DirectionType.TwoWayHorizontal);
            prefab.AddAnimation("run_left", "ItemAPI/Resources/BigSlime/MoveLeft", fps: 7, AnimationType.Move, DirectionType.TwoWayHorizontal);

            //Add the behavior here, this too can be a custom class that extends AttackBehaviorBase or something like that
            var bs = prefab.GetComponent <BehaviorSpeculator>();

            bs.MovementBehaviors.Add(new CompanionFollowPlayerBehavior()
            {
                IdleAnimations = new string[] { "idle" }
            });
        }
Пример #7
0
        public static void Init()
        {
            GameObject gameObject = ItemAPI.SpriteBuilder.SpriteFromResource("Items/Enemies/Sprites/potj");

            gameObject.AddAnimation("start", "Items/Enemies/Sprites/POTJ/Start", 8, Library.AnimationType.Idle, DirectionalAnimation.DirectionType.None, DirectionalAnimation.FlipType.None, tk2dSpriteAnimationClip.WrapMode.Once);
            gameObject.AddAnimation("idle", "Items/Enemies/Sprites/POTJ/Idle", 10, Library.AnimationType.Idle, DirectionalAnimation.DirectionType.None, DirectionalAnimation.FlipType.None, tk2dSpriteAnimationClip.WrapMode.Loop);
            gameObject.AddComponent <PrinceOfTheJammed>();
            ItemAPI.FakePrefab.MarkAsFakePrefab(gameObject);
            gameObject.SetActive(false);


            SpeculativeRigidbody specBody = gameObject.GetComponent <tk2dSprite>().SetUpSpeculativeRigidbody(new IntVector2(+3, +8), new IntVector2(16, 16));

            specBody.PixelColliders.Clear();

            specBody.PixelColliders.Add(new PixelCollider
            {
                ColliderGenerationMode = PixelCollider.PixelColliderGeneration.Manual,
                CollisionLayer         = CollisionLayer.EnemyCollider,
                IsTrigger = false,
                BagleUseFirstFrameOnly = false,
                SpecifyBagelFrame      = string.Empty,
                BagelColliderNumber    = 0,
                ManualOffsetX          = 3,
                ManualOffsetY          = 8,
                ManualWidth            = 16,
                ManualHeight           = 16,
                ManualDiameter         = 0,
                ManualLeftX            = 0,
                ManualLeftY            = 0,
                ManualRightX           = 0,
                ManualRightY           = 0,
            });

            specBody.PixelColliders.Add(new PixelCollider
            {
                ColliderGenerationMode = PixelCollider.PixelColliderGeneration.Manual,
                CollisionLayer         = CollisionLayer.EnemyHitBox,
                IsTrigger = false,
                BagleUseFirstFrameOnly = false,
                SpecifyBagelFrame      = string.Empty,
                BagelColliderNumber    = 0,
                ManualOffsetX          = 3,
                ManualOffsetY          = 8,
                ManualWidth            = 16,
                ManualHeight           = 16,
                ManualDiameter         = 0,
                ManualLeftX            = 0,
                ManualLeftY            = 0,
                ManualRightX           = 0,
                ManualRightY           = 0,
            });

            specBody.CollideWithTileMap = false;
            specBody.CollideWithOthers  = true;


            PJPrefab = gameObject;
        }
Пример #8
0
        // Token: 0x06000059 RID: 89 RVA: 0x0000480C File Offset: 0x00002A0C
        public static void Add()
        {
            ShrineFactory SQUIRE = new ShrineFactory
            {
                name                  = "Squire of the Jammed",
                modID                 = "BunnyMod",
                spritePath            = "BunnyMod/Resources/JammedSquire/Idle/squire_idle_001.png",
                shadowSpritePath      = "BunnyMod/Resources/JammedSquire/Idle/squire_idle_001.png",
                acceptText            = "I accept His offer.",
                declineText           = "I refuse.",
                OnAccept              = new Action <PlayerController, GameObject>(JammedSquire.Accept),
                OnDecline             = null,
                CanUse                = new Func <PlayerController, GameObject, bool>(JammedSquire.CanUse),
                offset                = new Vector3(48.375f, 50.8f, 51.3f),
                talkPointOffset       = new Vector3(0f, 3f, 0f),
                isToggle              = false,
                isBreachShrine        = true,
                interactableComponent = typeof(JammedSquireInteractable)
            };
            GameObject gameObject = SQUIRE.Build();

            gameObject.AddAnimation("idle", "BunnyMod/Resources/JammedSquire/Idle/", 4, NPCBuilder.AnimationType.Idle, DirectionalAnimation.DirectionType.None, DirectionalAnimation.FlipType.None);
            gameObject.AddAnimation("talk", "BunnyMod/Resources/JammedSquire/Talk/", 4, NPCBuilder.AnimationType.Talk, DirectionalAnimation.DirectionType.None, DirectionalAnimation.FlipType.None);
            gameObject.AddAnimation("talk_start", "BunnyMod/Resources/JammedSquire/TalkStart/", 4, NPCBuilder.AnimationType.Other, DirectionalAnimation.DirectionType.None, DirectionalAnimation.FlipType.None);
            gameObject.AddAnimation("do_effect", "BunnyMod/Resources/JammedSquire/DoEffect/", 7, NPCBuilder.AnimationType.Other, DirectionalAnimation.DirectionType.None, DirectionalAnimation.FlipType.None);
            JammedSquireInteractable component1 = gameObject.GetComponent <JammedSquireInteractable>();

            component1.conversation = new List <string>
            {
                "...",
                "My Lord has always been curious of your kind...",
                "Trying to manipulate things out of your control...",
                "Messing with things you shouldn't...",
                "Obtaining treasure that overpowers you...",
                "My Lord is... interested...",
                "Interested in you sheer stubborness for power...",
                "So, He sent me here to for one thing...",
                "To give you power, strength, riches...",
                "At the cost of Him not holding back...",
                "His army... And Himself...",
                "What do you say, Gungeoneer...?"
            };
            component1.conversationB = new List <string>
            {
                "What do you ask of Him...?"
            };
            component1.declineTextB = "I ask nothing more.";
            component1.acceptTextB  = "Remove His offer from me.";
            //gameObject.SetActive(false);
        }
Пример #9
0
        public static GameObject CreatePlayerGO(ContentManager content, GraphicsDevice gd)
        {
            if (characterSprite == null)
            {
                characterSprite = content.Load <Texture2D>("Characters/MainCharacter");
            }

            GameObject playerGO = new GameObject();

            playerGO.AddTransform();
            playerGO.AddAudio();
            playerGO.Audio.AddSFX("Pickup", content.Load <SoundEffect>("Sounds/PlayerSounds/Pickup"));
            playerGO.Audio.AddSFX("Shank", content.Load <SoundEffect>("Sounds/PlayerSounds/Shank"));
            playerGO.AddAnimation(characterSprite, new Vector2(28f, 30f));
            playerGO.Animation.AddAnimation("Idle", 0, 1);
            playerGO.Animation.AddAnimation("Run", 0, 4);
            playerGO.Animation.AddAnimation("Hide", 2, 1);
            playerGO.Animation.AddAnimation("Stab", 3, 1);
            playerGO.Animation.AddAnimation("Stealth", 1, 4);
            playerGO.Animation.AddAnimation("Elevator", 5, 1);
            playerGO.Animation.AddAnimation("VentIdle", 4, 1);
            playerGO.Animation.AddAnimation("VentCrawl", 4, 4);
            playerGO.AddRenderer(gd, SpriteTransparency.Transparent);
            playerGO.AddDynamicRigidBody(new Vector2(28f, 30f));
            playerGO.RigidBody.CollisionCategory = CollisionCats.PlayerCategory;
            playerGO.AddScript(new PlayerScript(playerGO));

            return(playerGO);
        }
Пример #10
0
        public static GameObject CreateTysonGO(ContentManager manager, GraphicsDevice gd, PlayerScript playerScript)
        {
            if (tysonSprite == null)
            {
                tysonSprite = manager.Load <Texture2D>("Characters/MikeTyson");
            }

            GameObject tyson = new GameObject();

            tyson.AddTransform();
            tyson.AddAnimation(tysonSprite, new Vector2(60f, 119f));
            tyson.Animation.AddAnimation("Idle", 0, 4);
            tyson.Animation.AddAnimation("Die", 1, 3, false);
            tyson.Animation.Play("Idle");
            tyson.AddRenderer(gd, SpriteTransparency.Transparent);
            tyson.AddTrigger(new Vector2(80f, 119f));
            tyson.Trigger.CollidesWith = CollisionCats.PlayerCategory;
            ShankTargetScript tysonScript = new ShankTargetScript(tyson, playerScript);

            tyson.AddScript(tysonScript);
            tyson.Trigger.OnEnter += new FarseerPhysics.Dynamics.OnCollisionEventHandler(tysonScript.OnEnter);
            tyson.Trigger.OnStay  += new FarseerPhysics.Dynamics.OnSeparationEventHandler(tysonScript.OnStay);

            return(tyson);
        }
Пример #11
0
 public static void SetupChromaDroids()
 {
     //TOM
     #region SetupTom
     if (redDroidPrefab == null || !CompanionBuilder.companionDictionary.ContainsKey(RedDroidGuid))
     {
         redDroidPrefab = CompanionBuilder.BuildPrefab("ChromaGun Red Droid", RedDroidGuid, "NevernamedsItems/Resources/Companions/ChromaGunDroids/chromadroid_red_idle_001", new IntVector2(5, 1), new IntVector2(6, 6));
         var companionController = redDroidPrefab.AddComponent <CompanionController>();
         companionController.aiActor.MovementSpeed     = 6.5f;
         companionController.CanCrossPits              = true;
         companionController.aiActor.CollisionDamage   = 0;
         companionController.aiActor.ActorShadowOffset = new Vector3(0, -0.5f);
         redDroidPrefab.AddAnimation("idle", "NevernamedsItems/Resources/Companions/ChromaGunDroids/chromadroid_red_idle", 12, CompanionBuilder.AnimationType.Idle, DirectionalAnimation.DirectionType.None, DirectionalAnimation.FlipType.None);
         BehaviorSpeculator component = redDroidPrefab.GetComponent <BehaviorSpeculator>();
         CustomCompanionBehaviours.SimpleCompanionMeleeAttack redDroidAttack = new CustomCompanionBehaviours.SimpleCompanionMeleeAttack();
         redDroidAttack.DamagePerTick         = 5;
         redDroidAttack.DesiredDistance       = 2;
         redDroidAttack.TickDelay             = 1f;
         redDroidAttack.selfKnockbackAmount   = 10;
         redDroidAttack.targetKnockbackAmount = 10;
         CustomCompanionBehaviours.ChromaGunDroneApproach redDroidApproach = new CustomCompanionBehaviours.ChromaGunDroneApproach();
         redDroidApproach.DesiredDistance = 1;
         redDroidApproach.droneColour     = ColourType.RED;
         component.MovementBehaviors.Add(redDroidApproach);
         component.AttackBehaviors.Add(redDroidAttack);
         component.MovementBehaviors.Add(new CompanionFollowPlayerBehavior {
             IdleAnimations = new string[] { "idle" }
         });
     }
     #endregion
 }
Пример #12
0
        // Token: 0x06000059 RID: 89 RVA: 0x0000480C File Offset: 0x00002A0C
        public static void Add()
        {
            ShrineFactory ShrineFactory = new ShrineFactory
            {
                name                  = "Artifact Monger",
                modID                 = "BunnyMod",
                spritePath            = "BunnyMod/Resources/Artifacts/ArtifactNPC/Idle/artifactmonger_idle_001.png",
                shadowSpritePath      = "BunnyMod/Resources/Artifacts/ArtifactNPC/artifactmongerplaceshadow_001.png",
                acceptText            = "...Sure?",
                declineText           = "No thanks.",
                OnAccept              = new Action <PlayerController, GameObject>(ArtifactMonger.Accept),
                OnDecline             = null,
                CanUse                = new Func <PlayerController, GameObject, bool>(ArtifactMonger.CanUse),
                offset                = new Vector3(38.125f, 27f, 26.5f),
                talkPointOffset       = new Vector3(3f, 3f, 0f),
                isToggle              = false,
                isBreachShrine        = true,
                interactableComponent = typeof(ArtifactMongerInteractable)
            };
            GameObject gameObject = ShrineFactory.Build();

            gameObject.AddAnimation("idle", "BunnyMod/Resources/Artifacts/ArtifactNPC/Idle/", 2, NPCBuilder.AnimationType.Idle, DirectionalAnimation.DirectionType.None, DirectionalAnimation.FlipType.None);
            gameObject.AddAnimation("talk", "BunnyMod/Resources/Artifacts/ArtifactNPC/Talk/", 6, NPCBuilder.AnimationType.Talk, DirectionalAnimation.DirectionType.None, DirectionalAnimation.FlipType.None);
            gameObject.AddAnimation("talk_start", "BunnyMod/Resources/Artifacts/ArtifactNPC/TalkStart/", 6, NPCBuilder.AnimationType.Other, DirectionalAnimation.DirectionType.None, DirectionalAnimation.FlipType.None);
            gameObject.AddAnimation("do_effect", "BunnyMod/Resources/Artifacts/ArtifactNPC/DoEffect/", 5, NPCBuilder.AnimationType.Other, DirectionalAnimation.DirectionType.None, DirectionalAnimation.FlipType.None);
            ArtifactMongerInteractable component = gameObject.GetComponent <ArtifactMongerInteractable>();

            component.conversation = new List <string>
            {
                "helo!",
                "i com from favaway pwanet!",
                "soooooo fav awayyyyy!!",
                "and breng pwetty wocks!",
                "but te wocks hurt...",
                "...",
                "...do u want one? tu help me?"
            };
            component.conversationB = new List <string>
            {
                "u wont anytien else?"
            };
            component.declineTextB = "Im good.";
            component.acceptTextB  = "Please take them away.";
            gameObject.SetActive(false);
        }
Пример #13
0
        // Token: 0x0600004D RID: 77 RVA: 0x00004700 File Offset: 0x00002900
        public static void Add()
        {
            ShrineFactory shrineFactory = new ShrineFactory
            {
                name  = "The Jammomaster",
                modID = "nevernamedsMod",
                //text = "Might not be smart to stick around.",
                spritePath       = "NevernamedsItems/Resources/JammomasterSprites/jammomaster_idle_001.png",
                shadowSpritePath = "NevernamedsItems/Resources/JammomasterSprites/jammomaster_shadow_001.png",
                acceptText       = "I Accept",
                declineText      = "...no thanks",
                OnAccept         = new Action <PlayerController, GameObject>(TheJammomaster.Accept),
                OnDecline        = null,
                CanUse           = new Func <PlayerController, GameObject, bool>(TheJammomaster.CanUse),
                //offset = new Vector3(43.8f, 42.4f, 42.9f),
                offset                = new Vector3(51.2f, 50.8f, 51.3f),
                talkPointOffset       = new Vector3(0.75f, 1.5f, 0f),
                isToggle              = false,
                isBreachShrine        = true,
                interactableComponent = typeof(JammomasterInteractible)
            };
            GameObject gameObject = shrineFactory.Build();

            gameObject.AddAnimation("idle", "NevernamedsItems/Resources/JammomasterSprites/jammomaster_idle", 12, NPCBuilder.AnimationType.Idle, DirectionalAnimation.DirectionType.None, DirectionalAnimation.FlipType.None);
            gameObject.AddAnimation("talk", "NevernamedsItems/Resources/JammomasterSprites/jammomaster_talk", 12, NPCBuilder.AnimationType.Talk, DirectionalAnimation.DirectionType.None, DirectionalAnimation.FlipType.None);
            gameObject.AddAnimation("talk_start", "NevernamedsItems/Resources/JammomasterSprites/jammomaster_talk", 12, NPCBuilder.AnimationType.Other, DirectionalAnimation.DirectionType.None, DirectionalAnimation.FlipType.None);
            gameObject.AddAnimation("do_effect", "NevernamedsItems/Resources/JammomasterSprites/jammomaster_talk", 12, NPCBuilder.AnimationType.Other, DirectionalAnimation.DirectionType.None, DirectionalAnimation.FlipType.None);
            JammomasterInteractible component = gameObject.GetComponent <JammomasterInteractible>();

            component.conversation = new List <string>
            {
                "All things wise and wonderful...",
                "All creatures great and small...",
                "All things bright and beautiful...",
                "I've cursed them, one and all..."
            };
            component.conversation2 = new List <string>
            {
                "What?....",
                "What do you desire now, young one?"
            };
            component.declineText2 = "I am content";
            component.acceptText2  = "Please undo what is done...";
            //gameObject.SetActive(false);
        }
Пример #14
0
 // Token: 0x06000059 RID: 89 RVA: 0x0000480C File Offset: 0x00002A0C
 public static void Add()
 {
     try
     {
         ShrineFactory ShrineFactory = new ShrineFactory
         {
             name                  = "Chester",
             modID                 = "cak",
             spritePath            = "CakeMod/Resources/Chester/Chester_idle_001.png",
             shadowSpritePath      = "CakeMod/Resources/Chester/Chester_shadow_001.png",
             acceptText            = "It's a deal.",
             declineText           = "I don't think I want what you're offering.",
             OnAccept              = new Action <PlayerController, GameObject>(Chester.Accept),
             OnDecline             = null,
             CanUse                = new Func <PlayerController, GameObject, bool>(Chester.CanUse),
             offset                = new Vector3(60f, 35f, 51.3f),
             talkPointOffset       = new Vector3(2f, 2f, 0f),
             isToggle              = false,
             isBreachShrine        = true,
             interactableComponent = typeof(ChesterInteractible)
         };
         GameObject gameObject = ShrineFactory.Build();
         gameObject.AddAnimation("idle", "CakeMod/Resources/Chester/Chester_idle", 4, NPCBuilder.AnimationType.Idle, DirectionalAnimation.DirectionType.None, DirectionalAnimation.FlipType.None);
         gameObject.AddAnimation("talk", "CakeMod/Resources/Chester/Chester_idle", 4, NPCBuilder.AnimationType.Talk, DirectionalAnimation.DirectionType.None, DirectionalAnimation.FlipType.None);
         gameObject.AddAnimation("talk_start", "CakeMod/Resources/Chester/Chester_talk", 4, NPCBuilder.AnimationType.Other, DirectionalAnimation.DirectionType.None, DirectionalAnimation.FlipType.None);
         gameObject.AddAnimation("do_effect", "CakeMod/Resources/Chester/Chester_doeffect", 3, NPCBuilder.AnimationType.Other, DirectionalAnimation.DirectionType.None, DirectionalAnimation.FlipType.None);
         ChesterInteractible component = gameObject.GetComponent <ChesterInteractible>();
         component.conversation = new List <string>
         {
             "Heya, kid!",
             "You look like you need a hand!",
             "Say, pal, I've got a deal for ya.",
             "Let's make this a bit easier, yeah?"
         };
         gameObject.SetActive(false);
     }
     catch (Exception e)
     {
         Tools.Print(e);
     }
 }
Пример #15
0
        public static void Add()
        {
            ShrineFactory shrineFactory = new ShrineFactory
            {
                name  = "Nuclear Shrine",
                modID = "bot_nt",
                //text = "Might not be smart to stick around.",
                spritePath       = "LostItems/NuclearThrone/NuclearThroneSprite/NPC/Idle/ntNPC_idle_001.png",
                shadowSpritePath = "LostItems/NuclearThrone/NuclearThroneSprite/NPC/Idle/ntNPC_idle_001.png",
                acceptText       = "Bring it on!",
                declineText      = "No thanks.",
                OnAccept         = new Action <PlayerController, GameObject>(NuclearShrine.Accept),
                OnDecline        = null,
                CanUse           = new Func <PlayerController, GameObject, bool>(NuclearShrine.CanUse),
                //offset = new Vector3(43.8f, 42.4f, 42.9f),
                offset                = new Vector3(188.8f, 18.3f, 18.9f),
                talkPointOffset       = new Vector3(0.75f, 1.5f, 0f),
                isToggle              = false,
                isBreachShrine        = true,
                interactableComponent = typeof(NuclearInteractable)
            };
            GameObject gameObject = shrineFactory.Build();

            gameObject.AddAnimation("idle", "LostItems/NuclearThrone/NuclearThroneSprite/NPC/Idle", 12, NPCBuilder.AnimationType.Idle, DirectionalAnimation.DirectionType.None, DirectionalAnimation.FlipType.None);
            gameObject.AddAnimation("talk", "LostItems/NuclearThrone/NuclearThroneSprite/NPC/Talk/", 12, NPCBuilder.AnimationType.Talk, DirectionalAnimation.DirectionType.None, DirectionalAnimation.FlipType.None);
            gameObject.AddAnimation("talk_start", "LostItems/NuclearThrone/NuclearThroneSprite/NPC/StartTalk/", 12, NPCBuilder.AnimationType.Other, DirectionalAnimation.DirectionType.None, DirectionalAnimation.FlipType.None);
            gameObject.AddAnimation("do_effect", "LostItems/NuclearThrone/NuclearThroneSprite/NPC/DoEffect/", 12, NPCBuilder.AnimationType.Other, DirectionalAnimation.DirectionType.None, DirectionalAnimation.FlipType.None);
            NuclearInteractable component = gameObject.GetComponent <NuclearInteractable>();

            component.conversation = new List <string>
            {
                "Hello ",
                //$"Hello <color={LostItemsMod.TEXT_COLOR_NT}>wip</color>",
                "I will be the npc that enables the upcoming NUCLEAR THRONE MODE",
                //$"I will be the npc that enables the upcoming <color={LostItemsMod.TEXT_COLOR_NT}>NUCLEAR THRONE MODE</color>",


                "But thats not finished"
            };
            //gameObject.SetActive(false);
        }
Пример #16
0
 // Token: 0x06000059 RID: 89 RVA: 0x0000480C File Offset: 0x00002A0C
 public static void Add()
 {
     try
     {
         ShrineFactory ShrineFactory = new ShrineFactory
         {
             name                  = "Shrap And Nel",
             modID                 = "cak",
             spritePath            = "CakeMod/Resources/TinyBullet/Idle/tinybullet_idle_001.png",
             acceptText            = "Let's get explodey!",
             declineText           = "I'm fine.",
             OnAccept              = new Action <PlayerController, GameObject>(TinyBullet.Accept),
             OnDecline             = null,
             CanUse                = new Func <PlayerController, GameObject, bool>(TinyBullet.CanUse),
             offset                = new Vector3(40f, 40f, 51.3f),
             talkPointOffset       = new Vector3(1f, 1f, 0f),
             isToggle              = false,
             isBreachShrine        = true,
             interactableComponent = typeof(TinyBulletInteractable)
         };
         GameObject gameObject = ShrineFactory.Build();
         gameObject.AddAnimation("idle", "CakeMod/Resources/TinyBullet/Idle/", 2, NPCBuilder.AnimationType.Idle, DirectionalAnimation.DirectionType.None, DirectionalAnimation.FlipType.None);
         gameObject.AddAnimation("talk", "CakeMod/Resources/TinyBullet/Talk/", 6, NPCBuilder.AnimationType.Talk, DirectionalAnimation.DirectionType.None, DirectionalAnimation.FlipType.None);
         gameObject.AddAnimation("talk_start", "CakeMod/Resources/TinyBullet/Talk/", 6, NPCBuilder.AnimationType.Other, DirectionalAnimation.DirectionType.None, DirectionalAnimation.FlipType.None);
         gameObject.AddAnimation("do_effect", "CakeMod/Resources/TinyBullet/Talk/", 5, NPCBuilder.AnimationType.Other, DirectionalAnimation.DirectionType.None, DirectionalAnimation.FlipType.None);
         TinyBulletInteractable component = gameObject.GetComponent <TinyBulletInteractable>();
         component.conversation = new List <string>
         {
             "Yoooo!",
             "Got out of that dungeon crawling stuff.",
             "Not that much to do up here.",
             "Wanna get booming?"
         };
         gameObject.SetActive(false);
     }
     catch (Exception e)
     {
         Tools.Print(e);
     }
 }
Пример #17
0
 // Token: 0x06000059 RID: 89 RVA: 0x0000480C File Offset: 0x00002A0C
 public static void Add()
 {
     try
     {
         ShrineFactory ShrineFactory = new ShrineFactory
         {
             name                  = "OldManBreach",
             modID                 = "cak",
             spritePath            = "CakeMod/Resources/OldManBreach/oldman_idle_001.png",
             shadowSpritePath      = "CakeMod/Resources/OldManBreach/oldman_shadow_001.png",
             acceptText            = "It's a deal.",
             declineText           = "I don't think I want what you're offering.",
             OnAccept              = new Action <PlayerController, GameObject>(OldManBreach.Accept),
             OnDecline             = null,
             CanUse                = new Func <PlayerController, GameObject, bool>(OldManBreach.CanUse),
             offset                = new Vector3(35f, 45f, 51.3f),
             talkPointOffset       = new Vector3(1f, 2f, 0f),
             isToggle              = false,
             isBreachShrine        = true,
             interactableComponent = typeof(OldManBreachInteractable)
         };
         GameObject gameObject = ShrineFactory.Build();
         gameObject.AddAnimation("idle", "CakeMod/Resources/OldManBreach/oldman_idle", 4, NPCBuilder.AnimationType.Idle, DirectionalAnimation.DirectionType.None, DirectionalAnimation.FlipType.None);
         gameObject.AddAnimation("talk", "CakeMod/Resources/OldManBreach/oldman_idle", 4, NPCBuilder.AnimationType.Talk, DirectionalAnimation.DirectionType.None, DirectionalAnimation.FlipType.None);
         gameObject.AddAnimation("talk_start", "CakeMod/Resources/OldManBreach/oldman_idle", 4, NPCBuilder.AnimationType.Other, DirectionalAnimation.DirectionType.None, DirectionalAnimation.FlipType.None);
         gameObject.AddAnimation("do_effect", "CakeMod/Resources/OldManBreach/oldman_talk", 3, NPCBuilder.AnimationType.Other, DirectionalAnimation.DirectionType.None, DirectionalAnimation.FlipType.None);
         OldManBreachInteractable component = gameObject.GetComponent <OldManBreachInteractable>();
         component.conversation = new List <string>
         {
             "Hey, you!",
             "It's dangerous to go alone!",
             "Take this!"
         };
         gameObject.SetActive(false);
     }
     catch (Exception e)
     {
         Tools.Print(e);
     }
 }
Пример #18
0
        public static void BuildPrefab()
        {
            if (prefab != null || CompanionBuilder.companionDictionary.ContainsKey(guid))
            {
                return;
            }

            //Create the prefab with a starting sprite and hitbox offset/size
            prefab = CompanionBuilder.BuildPrefab("Winpetster", guid, "CakeMod/Resources/Winpetster/Idle/son_idle_001", new IntVector2(1, 0), new IntVector2(17, 22));


            //Add a companion component to the prefab (could be a custom class)
            var companion = prefab.AddComponent <WinpetsterBehavior>();

            companion.aiActor.MovementSpeed = 2.5f;

            //Add all of the needed animations (most of the animations need to have specific names to be recognized, like idle_right or attack_left)
            prefab.AddAnimation("idle_right", "CakeMod/Resources/Winpetster/Idle", fps: 10, AnimationType.Idle, DirectionType.TwoWayHorizontal);
            prefab.AddAnimation("idle_left", "CakeMod/Resources/Winpetster/Idle", fps: 10, AnimationType.Idle, DirectionType.TwoWayHorizontal);
            prefab.AddAnimation("run_right", "CakeMod/Resources/Winpetster/MoveRight", fps: 10, AnimationType.Move, DirectionType.TwoWayHorizontal);
            prefab.AddAnimation("run_left", "CakeMod/Resources/Winpetster/MoveLeft", fps: 10, AnimationType.Move, DirectionType.TwoWayHorizontal);

            //Add the behavior here, this too can be a custom class that extends AttackBehaviorBase or something like that
            BehaviorSpeculator bs = companion.behaviorSpeculator;

            companion.aiActor.MovementSpeed = 7f;
            companion.specRigidbody.Reinitialize();
            companion.specRigidbody.CollideWithTileMap = false;
            companion.aiActor.CanTargetEnemies         = true;
            bs.MovementBehaviors.Add(new CompanionFollowPlayerBehavior()
            {
                IdleAnimations = new string[] { "idle" }
            });
            bs.AttackBehaviors.Add(new Winpetster.WinpetsterAttackBehavior());
            bs.MovementBehaviors.Add(new Winpetster.ApproachEnemiesBehavior());
        }
Пример #19
0
        public static void BuildPrefab()
        {
            if (prefab != null || CompanionBuilder.companionDictionary.ContainsKey(guid))
            {
                return;
            }
            prefab = CompanionBuilder.BuildPrefab("Baby Robot original", guid, "katmod/Resources/Companions/BabyRobots/original/IdleRight/babyrobot_original_idle_right_001", new IntVector2(0, 0), new IntVector2(13, 13));
            var companion = prefab.AddComponent <CompanionController>();

            companion.aiActor.MovementSpeed = 5f;
            prefab.AddAnimation("idle_right", "katmod/Resources/Companions/BabyRobots/original/IdleRight", 5, AnimationType.Idle, DirectionType.TwoWayHorizontal);
            prefab.AddAnimation("idle_left", "katmod/Resources/Companions/BabyRobots/original/IdleLeft", 5, AnimationType.Idle, DirectionType.TwoWayHorizontal);
            prefab.AddAnimation("run_right", "katmod/Resources/Companions/BabyRobots/original/MoveRight", 7, AnimationType.Move, DirectionType.TwoWayHorizontal);
            prefab.AddAnimation("run_left", "katmod/Resources/Companions/BabyRobots/original/MoveLeft", 7, AnimationType.Move, DirectionType.TwoWayHorizontal);
            prefab.AddAnimation("attack_right", "katmod/Resources/Companions/BabyRobots/original/AttackRight", 16, AnimationType.Idle, DirectionType.TwoWayHorizontal);
            var bs = prefab.GetComponent <BehaviorSpeculator>();

            bs.MovementBehaviors.Add(new CompanionFollowPlayerBehavior()
            {
                IdleAnimations = new string[] { "idle" }
            });
            bs.MovementBehaviors.Add(new SimpleCompanionBehaviours.SimpleCompanionApproach(4));
            bs.AttackBehaviors.Add(new RobotAttackBehaviour());
        }
        public static GameObject CreateGuardGO(ContentManager content, GraphicsDevice gd, List<Vector2> points)
        {
            if (guardTexture == null)
            {
                guardTexture = content.Load<Texture2D>("Guard");
            }

            GameObject guard = new GameObject();

            guard.AddTransform();
            guard.AddAnimation(guardTexture, new Vector2(20f, 34f));
            guard.AddScript(new GuardScript(guard, points));
            guard.Animation.AddAnimation("Idle", 1, 1);
            guard.Animation.AddAnimation("Run", 0, 4);
            guard.AddDynamicRigidBody(new Vector2(20f, 34f));
            guard.Animation.Play("Idle");
            guard.AddRenderer(gd, SpriteTransparency.Transparent);

            return guard;
        }
        public static GameObject CreateGuardGO(ContentManager content, GraphicsDevice gd, List <Vector2> points)
        {
            if (guardTexture == null)
            {
                guardTexture = content.Load <Texture2D>("Guard");
            }

            GameObject guard = new GameObject();

            guard.AddTransform();
            guard.AddAnimation(guardTexture, new Vector2(20f, 34f));
            guard.AddScript(new GuardScript(guard, points));
            guard.Animation.AddAnimation("Idle", 1, 1);
            guard.Animation.AddAnimation("Run", 0, 4);
            guard.AddDynamicRigidBody(new Vector2(20f, 34f));
            guard.Animation.Play("Idle");
            guard.AddRenderer(gd, SpriteTransparency.Transparent);

            return(guard);
        }
        public static GameObject CreateLaserGO(ContentManager content, GraphicsDevice gd)
        {
            if (laserSprite == null)
            {
                laserSprite = content.Load <Texture2D>("Obstacles/Laser");
            }

            GameObject laser = new GameObject();

            laser.AddTransform();
            laser.AddAnimation(laserSprite, new Vector2(32f, 16f));
            laser.Animation.AddAnimation("Off", 0, 1);
            laser.Animation.AddAnimation("On", 1, 1);
            laser.Animation.Play("On");
            laser.AddRenderer(gd, SpriteTransparency.Transparent);
            laser.AddTrigger(new Vector2(32f, 16f));
            laser.Trigger.CollidesWith = CollisionCats.PlayerCategory;
            LaserScript laserScript = new LaserScript(laser);

            laser.AddScript(laserScript);
            laser.Trigger.OnEnter += new FarseerPhysics.Dynamics.OnCollisionEventHandler(laserScript.TriggerEnter);

            return(laser);
        }
        public static GameObject CreateFanGO(ContentManager manager, GraphicsDevice gd)
        {
            if (fanSprite == null)
            {
                fanSprite = manager.Load <Texture2D>("Obstacles/Fan");
            }

            GameObject fan = new GameObject();

            fan.AddTransform();
            fan.AddAnimation(fanSprite, new Vector2(62f, 58f));
            fan.Animation.AddAnimation("Idle", 0, 1);
            fan.Animation.AddAnimation("Spin", 0, 2);
            fan.Animation.Play("Spin");
            fan.AddRenderer(gd, SpriteTransparency.Opaque);
            fan.AddTrigger(new Vector2(62f, 58f));
            fan.Trigger.CollidesWith = CollisionCats.PlayerCategory;
            FanScript fanScript = new FanScript(fan);

            fan.AddScript(fanScript);
            fan.Trigger.OnEnter += new FarseerPhysics.Dynamics.OnCollisionEventHandler(fanScript.TriggerEnter);

            return(fan);
        }
        public static GameObject CreateTysonGO(ContentManager manager, GraphicsDevice gd, PlayerScript playerScript)
        {
            if (tysonSprite == null)
            {
                tysonSprite = manager.Load<Texture2D>("Characters/MikeTyson");
            }

            GameObject tyson = new GameObject();

            tyson.AddTransform();
            tyson.AddAnimation(tysonSprite, new Vector2(60f, 119f));
            tyson.Animation.AddAnimation("Idle", 0, 4);
            tyson.Animation.AddAnimation("Die", 1, 3, false);
            tyson.Animation.Play("Idle");
            tyson.AddRenderer(gd, SpriteTransparency.Transparent);
            tyson.AddTrigger(new Vector2(80f, 119f));
            tyson.Trigger.CollidesWith = CollisionCats.PlayerCategory;
            ShankTargetScript tysonScript = new ShankTargetScript(tyson, playerScript);
            tyson.AddScript(tysonScript);
            tyson.Trigger.OnEnter += new FarseerPhysics.Dynamics.OnCollisionEventHandler(tysonScript.OnEnter);
            tyson.Trigger.OnStay += new FarseerPhysics.Dynamics.OnSeparationEventHandler(tysonScript.OnStay);

            return tyson;
        }
Пример #25
0
        public static void BuildPrefab()
        {
            if (prefab == null || !EnemyBuilder.Dictionary.ContainsKey(guid))
            {
                //Sets up the prefab of the enemy. The spritepath, "CakeMod/Resources/DemonGuy/Idle/milton_idle_001", determines the setup sprite for your enemy. vvvv This bool right here determines whether or not an enemy has an AiShooter or not. AIShooters are necessary if you want your enemy to hold a gun for example. An example of this can be seen in here.
                prefab = EnemyBuilder.BuildPrefab("DemonGuy", guid, "CakeMod/Resources/DemonGuy/Idle/bullet_demon_idle_001", new IntVector2(0, 0), new IntVector2(0, 0), true);
                //This line extends a BraveBehavior called EnemyBehavior, this is a generic behavior I use for setting up things that can't be setup in BuildPrefab.
                var enemy = prefab.AddComponent <EnemyBehavior>();
                //Here you can setup various things like movement speed, weight, and health. There's a lot you can do with the AiActor parameter so feel free to experiment.
                //For DemonGuy let's make him a flying enemy
                enemy.aiActor.MovementSpeed        = 2f;
                enemy.aiActor.knockbackDoer.weight = 100;
                enemy.aiActor.IgnoreForRoomClear   = false;
                enemy.aiActor.CollisionDamage      = 1f;
                enemy.aiActor.healthHaver.ForceSetCurrentHealth(30f);
                enemy.aiActor.healthHaver.SetHealthMaximum(45f, null, false);
                //This is where you setup your animations. Most animations need specific frame names to be recognized like idle or die.
                //The AddAnimation lines gets sprites from the folder specified in second phrase of the this line. At the very least you need an animation that contains the word idle for the idle animations for example.
                //AnimationType determines what kind of animation your making. In Gungeon there are 7 different Animation Types: Move, Idle, Fidget, Flight, Hit, Talk, Other. For a majority of these animations, these play automatically, however specific animations need to be told when to play such as Attack.
                //DirectionType determines the amount of ways an animation can face. You'll have to change your animation names to correspond with the DirectionType. For example if you want an animation to face eight ways you'll have to name your animations something like ""attack_south_west", "attack_north_east",  "attack_east", "attack_south_east",  "attack_north",  "attack_south", "attack_west", "attack_north_west" and change DirectionType to  DirectionType.EightWayOrdinal.
                //I suggest looking at the sprites of base game enemies to determine the names for the different directions.
                prefab.AddAnimation("idle_left", "CakeMod/Resources/DemonGuy/Idle", fps: 5, AnimationType.Idle, DirectionType.FourWay);
                prefab.AddAnimation("idle_right", "CakeMod/Resources/DemonGuy/Idle", fps: 5, AnimationType.Idle, DirectionType.FourWay);
                prefab.AddAnimation("move_front_right", "CakeMod/Resources/DemonGuy/MoveFrontRight", fps: 5, AnimationType.Move, DirectionType.FourWay);
                prefab.AddAnimation("move_back_right", "CakeMod/Resources/DemonGuy/MoveBackRight", fps: 5, AnimationType.Move, DirectionType.FourWay);
                prefab.AddAnimation("move_front_left", "CakeMod/Resources/DemonGuy/MoveFrontLeft", fps: 5, AnimationType.Move, DirectionType.FourWay);
                prefab.AddAnimation("move_back_left", "CakeMod/Resources/DemonGuy/MoveBackLeft", fps: 5, AnimationType.Move, DirectionType.FourWay);
                //Note that the "die"animations are only set to Move because they will be overwritten later.
                //tk2dSpriteAnimationClip.WrapMode.Once determines how an animation plays out. If you don't want it to loop, leave it to Once, otherwise you can change it to Loop or something.
                //Assign animation well, assigns an animation to an animation type. By default this is on, but since we're overwritting this set this to false.
                prefab.AddAnimation("die_left", "CakeMod/Resources/DemonGuy/Die", fps: 8, AnimationType.Move, DirectionType.TwoWayHorizontal, tk2dSpriteAnimationClip.WrapMode.Once, assignAnimation: false);
                prefab.AddAnimation("die_right", "CakeMod/Resources/DemonGuy/Die", fps: 8, AnimationType.Move, DirectionType.TwoWayHorizontal, tk2dSpriteAnimationClip.WrapMode.Once, assignAnimation: false);
                //Here we create a new DirectionalAnimation for our enemy to pull from.
                //Make sure the AnimNames correspong to the AddAnimation names.
                DirectionalAnimation idle = new DirectionalAnimation()
                {
                    AnimNames = new string[] { "idle_right", "idle_left" },
                    Flipped   = new FlipType[] { FlipType.None, FlipType.None },
                    Type      = DirectionType.TwoWayHorizontal,
                    Prefix    = string.Empty
                };
                DirectionalAnimation die = new DirectionalAnimation()
                {
                    AnimNames = new string[] { "die_right", "die_left" },
                    Flipped   = new FlipType[] { FlipType.None, FlipType.None },
                    Type      = DirectionType.TwoWayHorizontal,
                    Prefix    = string.Empty
                };
                //Because Dodge Roll is Dodge Roll and there is no animation types for death, we have to assign them to the Other category.
                enemy.aiAnimator.AssignDirectionalAnimation("die", die, AnimationType.Other);
                //This is where we get into the meat and potatoes of our enemy. This is where all the behaviors of our enemy are made.

                //this line adds a BehaviorSpeculator to our enemy which is the base for adding behaviors on to.
                var bs = prefab.GetComponent <BehaviorSpeculator>();
                //We're also going to duplicate the bulletbank and aishooter from the Bullet Kin.
                //The "762" represents the the gun id we want our enemy to hold. For a list of all gun ids, look at the items file on this github.
                //For now let's give him the finished gun.
                GameObject m_CachedGunAttachPoint = enemy.transform.Find("GunAttachPoint").gameObject;
                Vector2    offset = new Vector2(1f, -0.50f);
                m_CachedGunAttachPoint.transform.position = enemy.sprite.WorldCenter + offset;
                AIActor SourceEnemy = EnemyDatabase.GetOrLoadByGuid("5f3abc2d561b4b9c9e72b879c6f10c7e5f3abc2d561b4b9c9e72b879c6f10c7e");
                EnemyBuilder.DuplicateAIShooterAndAIBulletBank(prefab, SourceEnemy.aiShooter, SourceEnemy.GetComponent <AIBulletBank>(), 476, enemy.sprite.transform);

                //Here we will add some basic behaviors such as TargetPlayerBehavior and SeekTargetBehavior.
                //You can change many things in these behaviors so feel free to go nuts.
                bs.TargetBehaviors = new List <TargetBehaviorBase>
                {
                    new TargetPlayerBehavior
                    {
                        Radius              = 35f,
                        LineOfSight         = true,
                        ObjectPermanence    = true,
                        SearchInterval      = 0.25f,
                        PauseOnTargetSwitch = false,
                        PauseTime           = 0.25f,
                    }
                };
                //Now this is one of the most important behaviors because it allows our enemy to shoot.
                //If we want our enemy to shoot out of a gun, use ShootGunBehavior
                bs.AttackBehaviors = new List <AttackBehaviorBase>()
                {
                    new ShootGunBehavior()
                    {
                        GroupCooldownVariance = 0.2f,
                        LineOfSight           = false,
                        //With weapon type you can determine if you want your enemy to fire the gun directly or to use a bullet script. Let's use a Bullet Script for now. For the rest of code, let's modify it to be close to the Finished Gun.
                        WeaponType                   = WeaponType.BulletScript,
                        OverrideBulletName           = null,
                        BulletScript                 = new CustomBulletScriptSelector(typeof(DemonGuyScript)),
                        FixTargetDuringAttack        = true,
                        StopDuringAttack             = true,
                        LeadAmount                   = 0,
                        LeadChance                   = 1,
                        RespectReload                = true,
                        MagazineCapacity             = 6,
                        ReloadSpeed                  = 2f,
                        EmptiesClip                  = true,
                        SuppressReloadAnim           = false,
                        TimeBetweenShots             = -1,
                        PreventTargetSwitching       = true,
                        OverrideAnimation            = null,
                        OverrideDirectionalAnimation = null,
                        HideGun                      = false,
                        UseLaserSight                = false,
                        UseGreenLaser                = false,
                        PreFireLaserTime             = -1,
                        AimAtFacingDirectionWhenSafe = false,
                        Cooldown                     = 0.7f,
                        CooldownVariance             = 0,
                        AttackCooldown               = 0,
                        GlobalCooldown               = 0,
                        InitialCooldown              = 0,
                        InitialCooldownVariance      = 0,
                        GroupName                    = null,
                        GroupCooldown                = 0,
                        MinRange                     = 0,
                        Range                      = 16,
                        MinWallDistance            = 0,
                        MaxEnemiesInRoom           = 0,
                        MinHealthThreshold         = 0,
                        MaxHealthThreshold         = 1,
                        HealthThresholds           = new float[0],
                        AccumulateHealthThresholds = true,
                        targetAreaStyle            = null,
                        IsBlackPhantom             = false,
                        resetCooldownOnDamage      = null,
                        RequiresLineOfSight        = true,
                        MaxUsages                  = 0,
                    }
                };
                bs.MovementBehaviors = new List <MovementBehaviorBase>
                {
                    new SeekTargetBehavior
                    {
                        StopWhenInRange     = false,
                        CustomRange         = 15f,
                        LineOfSight         = false,
                        ReturnToSpawn       = false,
                        SpawnTetherDistance = 0f,
                        PathInterval        = 0.5f,
                        SpecifyRange        = false,
                        MinActiveRange      = 0f,
                        MaxActiveRange      = 0f
                    }
                };
                //Adds the enemy to MTG spawn pool and spawn command
                Game.Enemies.Add("cak:greeddemon", enemy.aiActor);
            }
        }
        public static void BuildPrefab()
        {
            if (prefab != null || CompanionBuilder.companionDictionary.ContainsKey(guid))
            {
                return;
            }

            //Create the prefab with a starting sprite and hitbox offset/size
            //prefab = CompanionBuilder.BuildPrefab("mistake", guid, "LostItems/sprites/Pets/mistake/Idle_front/mistake_pet_idle_001", new IntVector2(1, 0), new IntVector2(9, 9));
            prefab = CompanionBuilder.BuildPrefab("mistake", guid, "LostItems/sprites/Pets/mistake/mistake_pet_idle_001", new IntVector2(1, 0), new IntVector2(9, 9));

            //Add a companion component to the prefab (could be a custom class)
            var companion = prefab.AddComponent <CompanionController>();

            companion.aiActor.MovementSpeed = 5f;

            //Add all of the needed animations (most of the animations need to have specific names to be recognized, like idle_right or attack_left)
            //prefab.AddAnimation("idle_right", "ItemAPI/Resources/BigSlime/Idle", fps: 5, AnimationType.Idle, DirectionType.TwoWayHorizontal);
            prefab.AddAnimation("idle_right", "LostItems/sprites/Pets/mistake/idle_front", fps: 5, AnimationType.Idle, DirectionType.TwoWayHorizontal);
            //prefab.AddAnimation("idle_left", "ItemAPI/Resources/BigSlime/Idle", fps: 5, AnimationType.Idle, DirectionType.TwoWayHorizontal);
            prefab.AddAnimation("idle_left", "LostItems/sprites/Pets/mistake/idle_front", fps: 5, AnimationType.Idle, DirectionType.TwoWayHorizontal);
            //prefab.AddAnimation("run_right", "ItemAPI/Resources/BigSlime/MoveRight", fps: 7, AnimationType.Move, DirectionType.TwoWayHorizontal);
            prefab.AddAnimation("run_right", "LostItems/sprites/Pets/mistake/idle_front", fps: 7, AnimationType.Move, DirectionType.TwoWayHorizontal);
            //prefab.AddAnimation("run_left", "ItemAPI/Resources/BigSlime/MoveLeft", fps: 7, AnimationType.Move, DirectionType.TwoWayHorizontal);
            prefab.AddAnimation("run_left", "LostItems/sprites/Pets/mistake/idle_front", fps: 7, AnimationType.Move, DirectionType.TwoWayHorizontal);

            //Add the behavior here, this too can be a custom class that extends AttackBehaviorBase or something like that
            var bs = prefab.GetComponent <BehaviorSpeculator>();

            bs.MovementBehaviors.Add(new CompanionFollowPlayerBehavior()
            {
                IdleAnimations = new string[] { "idle" }
            });
            companion.CanInterceptBullets = true;
            //companion.CanInterceptBullets = true;
            companion.aiActor.healthHaver.PreventAllDamage     = true;
            companion.aiActor.specRigidbody.CollideWithOthers  = true;
            companion.aiActor.specRigidbody.CollideWithTileMap = false;
            companion.aiActor.healthHaver.ForceSetCurrentHealth(1f);
            companion.aiActor.healthHaver.SetHealthMaximum(1f, null, false);
            companion.aiActor.specRigidbody.PixelColliders.Clear();
            companion.aiActor.specRigidbody.PixelColliders.Add(new PixelCollider
            {
                ColliderGenerationMode = PixelCollider.PixelColliderGeneration.Manual,
                //CollisionLayer = CollisionLayer.PlayerCollider,
                CollisionLayer         = CollisionLayer.EnemyBulletBlocker,
                IsTrigger              = false,
                BagleUseFirstFrameOnly = false,
                SpecifyBagelFrame      = string.Empty,
                BagelColliderNumber    = 0,
                ManualOffsetX          = 0,
                ManualOffsetY          = 0,
                ManualWidth            = 16,
                ManualHeight           = 16,
                ManualDiameter         = 0,
                ManualLeftX            = 0,
                ManualLeftY            = 0,
                ManualRightX           = 0,
                ManualRightY           = 0
            });

            /*
             * companion.aiAnimator.specRigidbody.PixelColliders.Add(new PixelCollider
             * {
             *      ColliderGenerationMode = PixelCollider.PixelColliderGeneration.Manual,
             *      CollisionLayer = CollisionLayer.BulletBlocker,
             *      IsTrigger = false,
             *      BagleUseFirstFrameOnly = false,
             *      SpecifyBagelFrame = string.Empty,
             *      BagelColliderNumber = 0,
             *      ManualOffsetX = 0,
             *      ManualOffsetY = 0,
             *      ManualWidth = 16,
             *      ManualHeight = 16,
             *      ManualDiameter = 0,
             *      ManualLeftX = 0,
             *      ManualLeftY = 0,
             *      ManualRightX = 0,
             *      ManualRightY = 0
             * });
             */
        }
Пример #27
0
        public static void BuildPrefab()
        {
            AIActor source = EnemyDatabase.GetOrLoadByGuid("e21ac9492110493baef6df02a2682a0d");
            bool    flag   = prefab != null || EnemyBuilder.Dictionary.ContainsKey(guid);
            bool    flag2  = flag;

            if (!flag2)
            {
                prefab = EnemyBuilder.BuildPrefab("ChaosBeing", guid, spritePaths[0], new IntVector2(0, 0), new IntVector2(8, 9), false);
                var companion = prefab.AddComponent <EnemyBehavior>();
                ChaosBeing.shootpoint = new GameObject("f**k");
                ChaosBeing.shootpoint.transform.parent         = companion.transform;
                ChaosBeing.shootpoint.transform.position       = companion.sprite.WorldCenter;
                companion.aiActor.knockbackDoer.weight         = 200000;
                companion.aiActor.MovementSpeed               *= 0.25f;
                companion.aiActor.healthHaver.PreventAllDamage = false;
                companion.aiActor.CollisionDamage              = 1f;
                companion.aiActor.HasShadow                        = false;
                companion.aiActor.IgnoreForRoomClear               = true;
                companion.aiActor.aiAnimator.HitReactChance        = 0f;
                companion.aiActor.specRigidbody.CollideWithOthers  = true;
                companion.aiActor.specRigidbody.CollideWithTileMap = true;
                companion.aiActor.PreventFallingInPitsEver         = true;
                companion.aiActor.healthHaver.ForceSetCurrentHealth(75f);
                companion.aiActor.CollisionKnockbackStrength = 0f;
                companion.aiActor.CanTargetPlayers           = true;
                companion.aiActor.healthHaver.SetHealthMaximum(75f, null, false);
                companion.aiActor.specRigidbody.PixelColliders.Clear();

                GameObject AttachPoint = companion.transform.Find("f**k").gameObject;

                companion.aiActor.specRigidbody.PixelColliders.Add(new PixelCollider


                {
                    ColliderGenerationMode = PixelCollider.PixelColliderGeneration.Manual,
                    CollisionLayer         = CollisionLayer.EnemyCollider,
                    IsTrigger = false,
                    BagleUseFirstFrameOnly = false,
                    SpecifyBagelFrame      = string.Empty,
                    BagelColliderNumber    = 0,
                    ManualOffsetX          = 0,
                    ManualOffsetY          = 0,
                    ManualWidth            = 15,
                    ManualHeight           = 17,
                    ManualDiameter         = 0,
                    ManualLeftX            = 0,
                    ManualLeftY            = 0,
                    ManualRightX           = 0,
                    ManualRightY           = 0
                });
                companion.aiActor.specRigidbody.PixelColliders.Add(new PixelCollider
                {
                    ColliderGenerationMode = PixelCollider.PixelColliderGeneration.Manual,
                    CollisionLayer         = CollisionLayer.EnemyHitBox,
                    IsTrigger = false,
                    BagleUseFirstFrameOnly = false,
                    SpecifyBagelFrame      = string.Empty,
                    BagelColliderNumber    = 0,
                    ManualOffsetX          = 0,
                    ManualOffsetY          = 0,
                    ManualWidth            = 15,
                    ManualHeight           = 17,
                    ManualDiameter         = 0,
                    ManualLeftX            = 0,
                    ManualLeftY            = 0,
                    ManualRightX           = 0,
                    ManualRightY           = 0,
                });
                companion.aiActor.CorpseObject        = EnemyDatabase.GetOrLoadByGuid("1a78cfb776f54641b832e92c44021cf2").CorpseObject;
                companion.aiActor.PreventBlackPhantom = false;
                AIAnimator aiAnimator = companion.aiAnimator;

                prefab.AddAnimation("idle_right", "BunnyMod/Resources/ChaosEnemy/IdleRight/", fps: 4, AnimationType.Idle, DirectionalAnimation.DirectionType.TwoWayHorizontal);
                prefab.AddAnimation("idle_left", "BunnyMod/Resources/ChaosEnemy/IdleLeft/", fps: 4, AnimationType.Idle, DirectionalAnimation.DirectionType.TwoWayHorizontal);
                prefab.AddAnimation("move_right", "BunnyMod/Resources/ChaosEnemy/MoveRight/", fps: 4, AnimationType.Move, DirectionalAnimation.DirectionType.TwoWayHorizontal);
                prefab.AddAnimation("move_left", "BunnyMod/Resources/ChaosEnemy/MoveLeft/", fps: 4, AnimationType.Move, DirectionalAnimation.DirectionType.TwoWayHorizontal);
                prefab.AddAnimation("death_left", "BunnyMod/Resources/ChaosEnemy/DeathLeft/", fps: 4, AnimationType.Idle, DirectionalAnimation.DirectionType.TwoWayHorizontal);
                prefab.AddAnimation("death_right", "BunnyMod/Resources/ChaosEnemy/DeathRight/", fps: 4, AnimationType.Idle, DirectionalAnimation.DirectionType.TwoWayHorizontal);

                var bs = prefab.GetComponent <BehaviorSpeculator>();
                BehaviorSpeculator behaviorSpeculator = EnemyDatabase.GetOrLoadByGuid("e21ac9492110493baef6df02a2682a0d").behaviorSpeculator;
                BehaviorSpeculator load = EnemyDatabase.GetOrLoadByGuid("e21ac9492110493baef6df02a2682a0d").behaviorSpeculator;
                bs.OverrideBehaviors = behaviorSpeculator.OverrideBehaviors;
                bs.OtherBehaviors    = behaviorSpeculator.OtherBehaviors;
                bs.TargetBehaviors   = new List <TargetBehaviorBase>
                {
                    new TargetPlayerBehavior
                    {
                        Radius              = 1000f,
                        LineOfSight         = false,
                        ObjectPermanence    = true,
                        SearchInterval      = 0.25f,
                        PauseOnTargetSwitch = false,
                        PauseTime           = 0.25f
                    }
                };
                bs.MovementBehaviors = new List <MovementBehaviorBase>()
                {
                    new SeekTargetBehavior()
                    {
                        StopWhenInRange     = true,
                        CustomRange         = 6,
                        LineOfSight         = true,
                        ReturnToSpawn       = true,
                        SpawnTetherDistance = 0,
                        PathInterval        = 0.5f,
                        SpecifyRange        = false,
                        MinActiveRange      = 1,
                        MaxActiveRange      = 10
                    }
                };
                bs.AttackBehaviors = new List <AttackBehaviorBase>()
                {
                    new ShootBehavior()
                    {
                        ShootPoint = AttachPoint,

                        //GroupCooldownVariance = 0.2f,
                        //LineOfSight = false,
                        //WeaponType = WeaponType.BulletScript,
                        //OverrideBulletName = null,
                        BulletScript = new CustomBulletScriptSelector(typeof(ChaosAttck)),
                        //FixTargetDuringAttack = false,
                        //StopDuringAttack = false,
                        LeadAmount = 0.7f,
                        //LeadChance = 0.62f,
                        //RespectReload = true,
                        //MagazineCapacity = 1,
                        //ReloadSpeed = 3,
                        //EmptiesClip = true,
                        //SuppressReloadAnim = false,
                        //TimeBetweenShots = 0.5f,
                        PreventTargetSwitching = false,
                        //OverrideAnimation = null,
                        //OverrideDirectionalAnimation = null,
                        HideGun = true,
                        //UseLaserSight = false,
                        //UseGreenLaser = false,
                        //PreFireLaserTime = -1,
                        //AimAtFacingDirectionWhenSafe = false,
                        Cooldown                = 1f,
                        CooldownVariance        = 0,
                        AttackCooldown          = 0,
                        GlobalCooldown          = 0,
                        InitialCooldown         = 0,
                        InitialCooldownVariance = 0,
                        GroupName               = null,
                        GroupCooldown           = 0,
                        MinRange                = 0,
                        Range                      = 16,
                        MinWallDistance            = 0,
                        MaxEnemiesInRoom           = 0,
                        MinHealthThreshold         = 0,
                        MaxHealthThreshold         = 1,
                        HealthThresholds           = new float[0],
                        AccumulateHealthThresholds = true,
                        targetAreaStyle            = null,
                        IsBlackPhantom             = false,
                        resetCooldownOnDamage      = null,
                        RequiresLineOfSight        = false,
                        MaxUsages                  = 0,
                    }
                };


                //Tools.DebugInformation(load);
                AIActor aIActor = EnemyDatabase.GetOrLoadByGuid("e21ac9492110493baef6df02a2682a0d");
                bs.InstantFirstTick                = behaviorSpeculator.InstantFirstTick;
                bs.TickInterval                    = behaviorSpeculator.TickInterval;
                bs.PostAwakenDelay                 = behaviorSpeculator.PostAwakenDelay;
                bs.RemoveDelayOnReinforce          = behaviorSpeculator.RemoveDelayOnReinforce;
                bs.OverrideStartingFacingDirection = behaviorSpeculator.OverrideStartingFacingDirection;
                bs.StartingFacingDirection         = behaviorSpeculator.StartingFacingDirection;
                bs.SkipTimingDifferentiator        = behaviorSpeculator.SkipTimingDifferentiator;

                //GameObject m_CachedGunAttachPoint = companion.transform.Find("GunAttachPoint").gameObject;
                //EnemyBuilder.DuplicateAIShooterAndAIBulletBank(prefab, aIActor.aiShooter, aIActor.GetComponent<AIBulletBank>(), ChaosRevolver.ChaosRevolverID, m_CachedGunAttachPoint.transform);
                Game.Enemies.Add("bny:chaos_being", companion.aiActor);
            }
        }
Пример #28
0
        public static void BuildPrefab()
        {
            if (prefab != null || CompanionBuilder.companionDictionary.ContainsKey(guid))
            {
                return;
            }

            //Create the prefab with a starting sprite and hitbox offset/size
            prefab = CompanionBuilder.BuildPrefab("testbulon", guid, "CakeMod/Resources/Lovebulon/Idle/lovebulon_idle_001", new IntVector2(1, 0), new IntVector2(9, 9));

            //Add a companion component to the prefab (could be a custom class)
            var companion = prefab.GetComponent <BehaviorSpeculator>();
            BehaviorSpeculator BEHAVIORIAL = EnemyDatabase.GetOrLoadByGuid("42be66373a3d4d89b91a35c9ff8adfec").behaviorSpeculator;
            BehaviorSpeculator spec        = companion.behaviorSpeculator;

            spec.OverrideBehaviors = BEHAVIORIAL.OverrideBehaviors;
            spec.OtherBehaviors    = BEHAVIORIAL.OtherBehaviors;
            spec.TargetBehaviors   = BEHAVIORIAL.TargetBehaviors;

            spec.AttackBehaviors                               = BEHAVIORIAL.AttackBehaviors;
            spec.MovementBehaviors                             = BEHAVIORIAL.MovementBehaviors;
            spec.InstantFirstTick                              = BEHAVIORIAL.InstantFirstTick;
            spec.TickInterval                                  = BEHAVIORIAL.TickInterval;
            spec.PostAwakenDelay                               = BEHAVIORIAL.PostAwakenDelay;
            spec.RemoveDelayOnReinforce                        = BEHAVIORIAL.RemoveDelayOnReinforce;
            spec.OverrideStartingFacingDirection               = BEHAVIORIAL.OverrideStartingFacingDirection;
            spec.StartingFacingDirection                       = BEHAVIORIAL.StartingFacingDirection;
            spec.SkipTimingDifferentiator                      = BEHAVIORIAL.SkipTimingDifferentiator;
            companion.aiActor.MovementSpeed                    = 9f;
            companion.aiActor.healthHaver.PreventAllDamage     = false;
            companion.aiActor.CollisionDamage                  = 100f;
            companion.aiActor.HasShadow                        = false;
            companion.aiActor.CanTargetPlayers                 = true;
            companion.aiActor.specRigidbody.CollideWithOthers  = true;
            companion.aiActor.specRigidbody.CollideWithTileMap = true;
            companion.aiActor.healthHaver.ForceSetCurrentHealth(35f);
            companion.aiActor.healthHaver.SetHealthMaximum(35f, null, false);
            companion.aiActor.specRigidbody.PixelColliders.Clear();
            companion.aiActor.specRigidbody.PixelColliders.Add(new PixelCollider
            {
                ColliderGenerationMode = PixelCollider.PixelColliderGeneration.Manual,
                CollisionLayer         = CollisionLayer.EnemyCollider,
                IsTrigger = false,
                BagleUseFirstFrameOnly = false,
                SpecifyBagelFrame      = string.Empty,
                BagelColliderNumber    = 0,
                ManualOffsetX          = 20,
                ManualOffsetY          = 6,
                ManualWidth            = 11,
                ManualHeight           = 9,
                ManualDiameter         = 0,
                ManualLeftX            = 0,
                ManualLeftY            = 0,
                ManualRightX           = 0,
                ManualRightY           = 0
            });
            companion.aiActor.specRigidbody.PixelColliders.Add(new PixelCollider
            {
                ColliderGenerationMode = PixelCollider.PixelColliderGeneration.Manual,
                CollisionLayer         = CollisionLayer.EnemyHitBox,
                IsTrigger = false,
                BagleUseFirstFrameOnly = false,
                SpecifyBagelFrame      = string.Empty,
                BagelColliderNumber    = 0,
                ManualOffsetX          = 0,
                ManualOffsetY          = 0,
                ManualWidth            = 11,
                ManualHeight           = 9,
                ManualDiameter         = 0,
                ManualLeftX            = 0,
                ManualLeftY            = 0,
                ManualRightX           = 0,
                ManualRightY           = 0
            });

            //Add all of the needed animations (most of the animations need to have specific names to be recognized, like idle_right or attack_left)
            prefab.AddAnimation("idle_left", "CakeMod/Resources/Lovebulon/Idle", fps: 7, AnimationType.Idle, DirectionType.TwoWayHorizontal);
            prefab.AddAnimation("idle_right", "CakeMod/Resources/Lovebulon/Idle", fps: 7, AnimationType.Idle, DirectionType.TwoWayHorizontal);
            prefab.AddAnimation("run_left", "CakeMod/Resources/Lovebulon/Run", fps: 7, AnimationType.Move, DirectionType.TwoWayHorizontal);
            prefab.AddAnimation("run_right", "CakeMod/Resources/Lovebulon/Run", fps: 7, AnimationType.Move, DirectionType.TwoWayHorizontal);
            prefab.AddAnimation("pitfall", "CakeMod/Resources/Lovebulon/Fall", fps: 7, AnimationType.Idle, DirectionType.TwoWayHorizontal, tk2dSpriteAnimationClip.WrapMode.Once);
            //Note that the "die" and "attack" animations are only set to Move because they will be overwritten later.
            //tk2dSpriteAnimationClip.WrapMode.Once determines how an animation plays out. If you don't want it to loop, leave it to Once, otherwise you can change it to Loop or something.
            //Assign animation well assigns an animation to an animation type. By default this is on, but since we're overwritting this set this to false.
            prefab.AddAnimation("attack_left", "CakeMod/Resources/Lovebulon/Attack", fps: 8, AnimationType.Move, DirectionType.TwoWayHorizontal, tk2dSpriteAnimationClip.WrapMode.Once, assignAnimation: false);
            prefab.AddAnimation("attack_right", "CakeMod/Resources/Lovebulon/Attack", fps: 8, AnimationType.Move, DirectionType.TwoWayHorizontal, tk2dSpriteAnimationClip.WrapMode.Once, assignAnimation: false);
            prefab.AddAnimation("die_left", "CakeMod/Resources/Lovebulon/Die", fps: 12, AnimationType.Move, DirectionType.TwoWayHorizontal, tk2dSpriteAnimationClip.WrapMode.Once, assignAnimation: false);
            prefab.AddAnimation("die_right", "CakeMod/Resources/Lovebulon/Die", fps: 12, AnimationType.Move, DirectionType.TwoWayHorizontal, tk2dSpriteAnimationClip.WrapMode.Once, assignAnimation: false);
            //Here we create a new DirectionalAnimation for our enemy to pull from.
            //Make sure the AnimNames correspong to the AddAnimation names.
            DirectionalAnimation attack = new DirectionalAnimation()
            {
                AnimNames = new string[] { "attack_right", "attack_left" },
                Flipped   = new FlipType[] { FlipType.None, FlipType.None },
                Type      = DirectionType.TwoWayHorizontal,
                Prefix    = string.Empty
            };
            DirectionalAnimation die = new DirectionalAnimation()
            {
                AnimNames = new string[] { "die_right", "die_left" },
                Flipped   = new FlipType[] { FlipType.None, FlipType.None },
                Type      = DirectionType.TwoWayHorizontal,
                Prefix    = string.Empty
            };

            //Because Dodge Roll is Dodge Roll and there is no animation types for attack and death, we have to assign them to the Other category.
            companion.aiAnimator.AssignDirectionalAnimation("attack", attack, AnimationType.Other);
            companion.aiAnimator.AssignDirectionalAnimation("die", die, AnimationType.Other);

            //Add the behavior here, this too can be a custom class that extends AttackBehaviorBase or something like that
            var bs = prefab.GetComponent <BehaviorSpeculator>();

            bs.TargetBehaviors = new List <TargetBehaviorBase>()
            {
                new TargetPlayerBehavior()
                {
                    Radius              = 35,
                    LineOfSight         = false,
                    ObjectPermanence    = true,
                    SearchInterval      = 0.01f,
                    PauseOnTargetSwitch = false,
                    PauseTime           = 0f
                }
            };
            bs.MovementBehaviors = new List <MovementBehaviorBase>()
            {
                new SeekTargetBehavior()
                {
                    StopWhenInRange     = false,
                    CustomRange         = 6,
                    LineOfSight         = true,
                    ReturnToSpawn       = true,
                    SpawnTetherDistance = 0,
                    PathInterval        = 0.5f,
                    SpecifyRange        = false,
                    MinActiveRange      = 0,
                    MaxActiveRange      = 0
                }
            };
            Game.Enemies.Add("cak:testbulon", companion.aiActor);
        }
Пример #29
0
        public static void BuildPrefab()
        {
            AIActor source = EnemyDatabase.GetOrLoadByGuid("c50a862d19fc4d30baeba54795e8cb93");
            bool    flag   = prefab != null || EnemyBuilder.Dictionary.ContainsKey(guid);
            bool    flag2  = flag;

            if (!flag2)
            {
                prefab = EnemyBuilder.BuildPrefab("AbyssShotgunner", guid, spritePaths[0], new IntVector2(0, 0), new IntVector2(8, 9), true);
                var companion = prefab.AddComponent <EnemyBehavior>();
                companion.aiActor.knockbackDoer.weight         = 200;
                companion.aiActor.MovementSpeed                = 1.8f;
                companion.aiActor.healthHaver.PreventAllDamage = false;
                companion.aiActor.CollisionDamage              = 1f;
                companion.aiActor.HasShadow                        = false;
                companion.aiActor.IgnoreForRoomClear               = false;
                companion.aiActor.aiAnimator.HitReactChance        = 0.05f;
                companion.aiActor.specRigidbody.CollideWithOthers  = true;
                companion.aiActor.specRigidbody.CollideWithTileMap = true;
                companion.aiActor.PreventFallingInPitsEver         = true;
                companion.aiActor.healthHaver.ForceSetCurrentHealth(55f);
                companion.aiActor.CollisionKnockbackStrength = 5f;
                companion.aiActor.CanTargetPlayers           = true;
                companion.aiActor.healthHaver.SetHealthMaximum(55f, null, false);
                companion.aiActor.specRigidbody.PixelColliders.Clear();
                companion.aiActor.specRigidbody.PixelColliders.Add(new PixelCollider

                {
                    ColliderGenerationMode = PixelCollider.PixelColliderGeneration.Manual,
                    CollisionLayer         = CollisionLayer.EnemyCollider,
                    IsTrigger = false,
                    BagleUseFirstFrameOnly = false,
                    SpecifyBagelFrame      = string.Empty,
                    BagelColliderNumber    = 0,
                    ManualOffsetX          = 0,
                    ManualOffsetY          = 0,
                    ManualWidth            = 15,
                    ManualHeight           = 17,
                    ManualDiameter         = 0,
                    ManualLeftX            = 0,
                    ManualLeftY            = 0,
                    ManualRightX           = 0,
                    ManualRightY           = 0
                });
                companion.aiActor.specRigidbody.PixelColliders.Add(new PixelCollider
                {
                    ColliderGenerationMode = PixelCollider.PixelColliderGeneration.Manual,
                    CollisionLayer         = CollisionLayer.EnemyHitBox,
                    IsTrigger = false,
                    BagleUseFirstFrameOnly = false,
                    SpecifyBagelFrame      = string.Empty,
                    BagelColliderNumber    = 0,
                    ManualOffsetX          = 0,
                    ManualOffsetY          = 0,
                    ManualWidth            = 15,
                    ManualHeight           = 17,
                    ManualDiameter         = 0,
                    ManualLeftX            = 0,
                    ManualLeftY            = 0,
                    ManualRightX           = 0,
                    ManualRightY           = 0,
                });
                companion.aiActor.CorpseObject        = EnemyDatabase.GetOrLoadByGuid("01972dee89fc4404a5c408d50007dad5").CorpseObject;
                companion.aiActor.PreventBlackPhantom = false;
                AIAnimator aiAnimator = companion.aiAnimator;

                prefab.AddAnimation("idle_right", "BunnyMod/Resources/AbyssEnemies/AbyssShotgunner/IdleRight/", fps: 1, AnimationType.Idle, DirectionalAnimation.DirectionType.TwoWayHorizontal);
                prefab.AddAnimation("idle_left", "BunnyMod/Resources/AbyssEnemies/AbyssShotgunner/IdleLeft/", fps: 1, AnimationType.Idle, DirectionalAnimation.DirectionType.TwoWayHorizontal);
                prefab.AddAnimation("move_right", "BunnyMod/Resources/AbyssEnemies/AbyssShotgunner/MoveRight/", fps: 7, AnimationType.Move, DirectionalAnimation.DirectionType.TwoWayHorizontal);
                prefab.AddAnimation("move_left", "BunnyMod/Resources/AbyssEnemies/AbyssShotgunner/MoveLeft/", fps: 7, AnimationType.Move, DirectionalAnimation.DirectionType.TwoWayHorizontal);
                prefab.AddAnimation("death_left", "BunnyMod/Resources/AbyssEnemies/AbyssShotgunner/DeathLeft/", fps: 4, AnimationType.Idle, DirectionalAnimation.DirectionType.TwoWayHorizontal);
                prefab.AddAnimation("death_right", "BunnyMod/Resources/AbyssEnemies/AbyssShotgunner/DeathRight/", fps: 4, AnimationType.Idle, DirectionalAnimation.DirectionType.TwoWayHorizontal);

                var bs = prefab.GetComponent <BehaviorSpeculator>();
                BehaviorSpeculator behaviorSpeculator = EnemyDatabase.GetOrLoadByGuid("1bd8e49f93614e76b140077ff2e33f2b").behaviorSpeculator;
                BehaviorSpeculator load = EnemyDatabase.GetOrLoadByGuid("1bd8e49f93614e76b140077ff2e33f2b").behaviorSpeculator;
                bs.OverrideBehaviors = behaviorSpeculator.OverrideBehaviors;
                bs.OtherBehaviors    = behaviorSpeculator.OtherBehaviors;
                bs.TargetBehaviors   = new List <TargetBehaviorBase>
                {
                    new TargetPlayerBehavior
                    {
                        Radius              = 35f,
                        LineOfSight         = false,
                        ObjectPermanence    = true,
                        SearchInterval      = 0.25f,
                        PauseOnTargetSwitch = false,
                        PauseTime           = 0.25f
                    }
                };
                bs.MovementBehaviors = new List <MovementBehaviorBase>()
                {
                    new SeekTargetBehavior()
                    {
                        StopWhenInRange     = true,
                        CustomRange         = 6,
                        LineOfSight         = true,
                        ReturnToSpawn       = true,
                        SpawnTetherDistance = 0,
                        PathInterval        = 0.5f,
                        SpecifyRange        = false,
                        MinActiveRange      = 1,
                        MaxActiveRange      = 10
                    }
                };
                bs.AttackBehaviors = new List <AttackBehaviorBase>()
                {
                    new ShootGunBehavior()
                    {
                        GroupCooldownVariance        = 0.2f,
                        LineOfSight                  = false,
                        WeaponType                   = WeaponType.BulletScript,
                        OverrideBulletName           = null,
                        BulletScript                 = new CustomBulletScriptSelector(typeof(AbyssShottyAttack)),
                        FixTargetDuringAttack        = false,
                        StopDuringAttack             = false,
                        LeadAmount                   = 0,
                        LeadChance                   = 0.62f,
                        RespectReload                = true,
                        MagazineCapacity             = 1,
                        ReloadSpeed                  = 3,
                        EmptiesClip                  = true,
                        SuppressReloadAnim           = false,
                        TimeBetweenShots             = 0.5f,
                        PreventTargetSwitching       = false,
                        OverrideAnimation            = null,
                        OverrideDirectionalAnimation = null,
                        HideGun                      = false,
                        UseLaserSight                = false,
                        UseGreenLaser                = false,
                        PreFireLaserTime             = -1,
                        AimAtFacingDirectionWhenSafe = false,
                        Cooldown                     = 0.2f,
                        CooldownVariance             = 0,
                        AttackCooldown               = 0,
                        GlobalCooldown               = 0,
                        InitialCooldown              = 0,
                        InitialCooldownVariance      = 0,
                        GroupName                    = null,
                        GroupCooldown                = 0,
                        MinRange                     = 0,
                        Range                      = 16,
                        MinWallDistance            = 0,
                        MaxEnemiesInRoom           = 0,
                        MinHealthThreshold         = 0,
                        MaxHealthThreshold         = 1,
                        HealthThresholds           = new float[0],
                        AccumulateHealthThresholds = true,
                        targetAreaStyle            = null,
                        IsBlackPhantom             = false,
                        resetCooldownOnDamage      = null,
                        RequiresLineOfSight        = false,
                        MaxUsages                  = 0
                    }
                };
                //Tools.DebugInformation(load);
                AIActor aIActor = EnemyDatabase.GetOrLoadByGuid("1bd8e49f93614e76b140077ff2e33f2b");
                bs.InstantFirstTick                = behaviorSpeculator.InstantFirstTick;
                bs.TickInterval                    = behaviorSpeculator.TickInterval;
                bs.PostAwakenDelay                 = behaviorSpeculator.PostAwakenDelay;
                bs.RemoveDelayOnReinforce          = behaviorSpeculator.RemoveDelayOnReinforce;
                bs.OverrideStartingFacingDirection = behaviorSpeculator.OverrideStartingFacingDirection;
                bs.StartingFacingDirection         = behaviorSpeculator.StartingFacingDirection;
                bs.SkipTimingDifferentiator        = behaviorSpeculator.SkipTimingDifferentiator;
                GameObject m_CachedGunAttachPoint = companion.transform.Find("GunAttachPoint").gameObject;
                EnemyBuilder.DuplicateAIShooterAndAIBulletBank(prefab, aIActor.aiShooter, aIActor.GetComponent <AIBulletBank>(), 93, m_CachedGunAttachPoint.transform);
                Game.Enemies.Add("bny:abyss_shotgunner", companion.aiActor);
            }
        }
Пример #30
0
        public static void BuildPrefab()
        {
            bool flag = prefab != null || EnemyBuilder.Dictionary.ContainsKey(guid);

            bool flag2 = flag;

            if (!flag2)
            {
                prefab = EnemyBuilder.BuildPrefab("Peril Skull", guid, "Items/Enemies/Sprites/Peril_Skull/Idle/peril_skull_idle_001", new IntVector2(0, 0), new IntVector2(0, 0), false);
                var enemy = prefab.AddComponent <EnemyBehavior>();

                enemy.aiActor.knockbackDoer.weight         = 35;
                enemy.aiActor.MovementSpeed                = 5.5f;
                enemy.aiActor.healthHaver.PreventAllDamage = true;
                enemy.aiActor.CollisionDamage              = 1f;
                enemy.aiActor.HasShadow                        = false;
                enemy.aiActor.IgnoreForRoomClear               = true;
                enemy.aiActor.aiAnimator.HitReactChance        = 0f;
                enemy.aiActor.specRigidbody.CollideWithOthers  = true;
                enemy.aiActor.specRigidbody.CollideWithTileMap = false;
                enemy.aiActor.PreventFallingInPitsEver         = true;
                enemy.aiActor.CollisionKnockbackStrength       = 5f;
                enemy.aiActor.CanTargetPlayers                 = true;
                enemy.aiActor.healthHaver.SetHealthMaximum(999f, null, true);
                enemy.aiActor.SetIsFlying(true, "ghost", true, true);

                prefab.AddAnimation("idle", "Items/Enemies/Sprites/Peril_Skull/Idle", fps: 8, AnimationType.Idle, DirectionType.Single);
                prefab.AddAnimation("run", "Items/Enemies/Sprites/Peril_Skull/Run", fps: 8, AnimationType.Idle, DirectionType.Single);
                enemy.aiActor.specRigidbody.PixelColliders.Clear();
                enemy.aiActor.specRigidbody.PixelColliders.Add(new PixelCollider
                {
                    ColliderGenerationMode = PixelCollider.PixelColliderGeneration.Manual,
                    CollisionLayer         = CollisionLayer.EnemyCollider,
                    IsTrigger = false,
                    BagleUseFirstFrameOnly = false,
                    SpecifyBagelFrame      = string.Empty,
                    BagelColliderNumber    = 0,
                    ManualOffsetX          = 0,
                    ManualOffsetY          = 0,
                    ManualWidth            = 15,
                    ManualHeight           = 22,
                    ManualDiameter         = 0,
                    ManualLeftX            = 0,
                    ManualLeftY            = 0,
                    ManualRightX           = 0,
                    ManualRightY           = 0
                });
                enemy.aiActor.specRigidbody.PixelColliders.Add(new PixelCollider
                {
                    ColliderGenerationMode = PixelCollider.PixelColliderGeneration.Manual,
                    CollisionLayer         = CollisionLayer.EnemyHitBox,
                    IsTrigger = false,
                    BagleUseFirstFrameOnly = false,
                    SpecifyBagelFrame      = string.Empty,
                    BagelColliderNumber    = 0,
                    ManualOffsetX          = 0,
                    ManualOffsetY          = 0,
                    ManualWidth            = 15,
                    ManualHeight           = 22,
                    ManualDiameter         = 0,
                    ManualLeftX            = 0,
                    ManualLeftY            = 0,
                    ManualRightX           = 0,
                    ManualRightY           = 0,
                });
                enemy.aiActor.PreventBlackPhantom = true;
                var bs = prefab.GetComponent <BehaviorSpeculator>();
                BehaviorSpeculator behaviorSpeculator = EnemyDatabase.GetOrLoadByGuid("01972dee89fc4404a5c408d50007dad5").behaviorSpeculator;

                bs.OverrideBehaviors = behaviorSpeculator.OverrideBehaviors;
                bs.OtherBehaviors    = behaviorSpeculator.OtherBehaviors;
                bs.TargetBehaviors   = new List <TargetBehaviorBase>
                {
                    new TargetPlayerBehavior
                    {
                        Radius              = 999f,
                        LineOfSight         = false,
                        ObjectPermanence    = true,
                        SearchInterval      = 0.25f,
                        PauseOnTargetSwitch = false,
                        PauseTime           = 0.25f
                    }
                };
                bs.MovementBehaviors = new List <MovementBehaviorBase>
                {
                    new SeekTargetBehavior
                    {
                        StopWhenInRange     = false,
                        CustomRange         = 999f,
                        LineOfSight         = false,
                        ReturnToSpawn       = false,
                        SpawnTetherDistance = 0f,
                        PathInterval        = 0.25f,
                        SpecifyRange        = false,
                        MinActiveRange      = 0f,
                        MaxActiveRange      = 0f
                    }
                };
                bs.InstantFirstTick                = behaviorSpeculator.InstantFirstTick;
                bs.TickInterval                    = behaviorSpeculator.TickInterval;
                bs.PostAwakenDelay                 = behaviorSpeculator.PostAwakenDelay;
                bs.RemoveDelayOnReinforce          = behaviorSpeculator.RemoveDelayOnReinforce;
                bs.OverrideStartingFacingDirection = behaviorSpeculator.OverrideStartingFacingDirection;
                bs.StartingFacingDirection         = behaviorSpeculator.StartingFacingDirection;
                bs.SkipTimingDifferentiator        = behaviorSpeculator.SkipTimingDifferentiator;
                Game.Enemies.Add("cel:peril_skull", enemy.aiActor);
            }
        }
Пример #31
0
        public static void BuildPrefab()
        {
            if (prefab == null || !EnemyBuilder.Dictionary.ContainsKey(guid))
            {
                //Sets up the prefab of the enemy. The spritepath, "CakeMod/Resources/Waterbulon/Idle/milton_idle_001", determines the setup sprite for your enemy. vvvv This bool right here determines whether or not an enemy has an AiShooter or not. AIShooters are necessary if you want your enemy to hold a gun for example. An example of this can be seen in Humphrey.
                prefab = EnemyBuilder.BuildPrefab("Waterbulon", guid, "CakeMod/Resources/Waterbulon/Idle/waterbulon_idle_001", new IntVector2(0, 0), new IntVector2(0, 0), false);
                //This line extends a BraveBehavior called EnemyBehavior, this is a generic behavior I use for setting up things that can't be setup in BuildPrefab.
                var enemy = prefab.AddComponent <EnemyBehavior>();
                //Here you can setup various things like movement speed, weight, and health. There's a lot you can do with the AiActor parameter so feel free to experiment.
                enemy.aiActor.MovementSpeed        = 6.7f;
                enemy.aiActor.knockbackDoer.weight = 500;
                enemy.aiActor.IgnoreForRoomClear   = false;
                enemy.aiActor.CollisionDamage      = 1f;
                enemy.aiActor.healthHaver.ForceSetCurrentHealth(15f);
                enemy.aiActor.healthHaver.SetHealthMaximum(15f, null, false);

                enemy.aiActor.specRigidbody.PixelColliders.Add(new PixelCollider

                {
                    ColliderGenerationMode = PixelCollider.PixelColliderGeneration.Manual,
                    CollisionLayer         = CollisionLayer.EnemyCollider,
                    IsTrigger = false,
                    BagleUseFirstFrameOnly = false,
                    SpecifyBagelFrame      = string.Empty,
                    BagelColliderNumber    = 0,
                    ManualOffsetX          = 0,
                    ManualOffsetY          = 0,
                    ManualWidth            = 19,
                    ManualHeight           = 14,
                    ManualDiameter         = 0,
                    ManualLeftX            = 0,
                    ManualLeftY            = 0,
                    ManualRightX           = 0,
                    ManualRightY           = 0
                });
                enemy.aiActor.specRigidbody.PixelColliders.Add(new PixelCollider
                {
                    ColliderGenerationMode = PixelCollider.PixelColliderGeneration.Manual,
                    CollisionLayer         = CollisionLayer.EnemyHitBox,
                    IsTrigger = false,
                    BagleUseFirstFrameOnly = false,
                    SpecifyBagelFrame      = string.Empty,
                    BagelColliderNumber    = 0,
                    ManualOffsetX          = 0,
                    ManualOffsetY          = 0,
                    ManualWidth            = 19,
                    ManualHeight           = 14,
                    ManualDiameter         = 0,
                    ManualLeftX            = 0,
                    ManualLeftY            = 0,
                    ManualRightX           = 0,
                    ManualRightY           = 0,
                });

                //This is where you setup your animations. Most animations need specific frame names to be recognized like idle or die.
                //The AddAnimation lines gets sprites from the folder specified in second phrase of the this line. At the very least you need an animation that contains the word idle for the idle animations for example.
                //AnimationType determines what kind of animation your making. In Gungeon there are 7 different Animation Types: Move, Idle, Fidget, Flight, Hit, Talk, Other. For a majority of these animations, these play automatically, however specific animations need to be told when to play such as Attack.
                //DirectionType determines the amount of ways an animation can face. You'll have to change your animation names to correspond with the DirectionType. For example if you want an animation to face eight ways you'll have to name your animations something like ""attack_south_west", "attack_north_east",  "attack_east", "attack_south_east",  "attack_north",  "attack_south", "attack_west", "attack_north_west" and change DirectionType to  DirectionType.EightWayOrdinal.
                //I suggest looking at the sprites of base game enemies to determine the names for the different directions.
                prefab.AddAnimation("idle_left", "CakeMod/Resources/Waterbulon/Idle", fps: 7, AnimationType.Idle, DirectionType.TwoWayHorizontal);
                prefab.AddAnimation("idle_right", "CakeMod/Resources/Waterbulon/Idle", fps: 7, AnimationType.Idle, DirectionType.TwoWayHorizontal);
                prefab.AddAnimation("run_left", "CakeMod/Resources/Waterbulon/Run", fps: 7, AnimationType.Move, DirectionType.TwoWayHorizontal);
                prefab.AddAnimation("run_right", "CakeMod/Resources/Waterbulon/Run", fps: 7, AnimationType.Move, DirectionType.TwoWayHorizontal);
                //Note that the "die" and "attack" animations are only set to Move because they will be overwritten later.
                //tk2dSpriteAnimationClip.WrapMode.Once determines how an animation plays out. If you don't want it to loop, leave it to Once, otherwise you can change it to Loop or something.
                //Assign animation well assigns an animation to an animation type. By default this is on, but since we're overwritting this set this to false.
                prefab.AddAnimation("attack_left", "CakeMod/Resources/Waterbulon/Attack", fps: 8, AnimationType.Move, DirectionType.TwoWayHorizontal, tk2dSpriteAnimationClip.WrapMode.Once, assignAnimation: false);
                prefab.AddAnimation("attack_right", "CakeMod/Resources/Waterbulon/Attack", fps: 8, AnimationType.Move, DirectionType.TwoWayHorizontal, tk2dSpriteAnimationClip.WrapMode.Once, assignAnimation: false);
                prefab.AddAnimation("die_left", "CakeMod/Resources/Waterbulon/Die", fps: 8, AnimationType.Move, DirectionType.TwoWayHorizontal, tk2dSpriteAnimationClip.WrapMode.Once, assignAnimation: false);
                prefab.AddAnimation("die_right", "CakeMod/Resources/Waterbulon/Die", fps: 8, AnimationType.Move, DirectionType.TwoWayHorizontal, tk2dSpriteAnimationClip.WrapMode.Once, assignAnimation: false);
                //Here we create a new DirectionalAnimation for our enemy to pull from.
                //Make sure the AnimNames correspong to the AddAnimation names.
                DirectionalAnimation attack = new DirectionalAnimation()
                {
                    AnimNames = new string[] { "attack_right", "attack_left" },
                    Flipped   = new FlipType[] { FlipType.None, FlipType.None },
                    Type      = DirectionType.TwoWayHorizontal,
                    Prefix    = string.Empty
                };
                DirectionalAnimation die = new DirectionalAnimation()
                {
                    AnimNames = new string[] { "die_right", "die_left" },
                    Flipped   = new FlipType[] { FlipType.None, FlipType.None },
                    Type      = DirectionType.TwoWayHorizontal,
                    Prefix    = string.Empty
                };
                //Because Dodge Roll is Dodge Roll and there is no animation types for attack and death, we have to assign them to the Other category.
                enemy.aiAnimator.AssignDirectionalAnimation("attack", attack, AnimationType.Other);
                enemy.aiAnimator.AssignDirectionalAnimation("die", die, AnimationType.Other);
                //This is where we get into the meat and potatoes of our enemy. This is where all the behaviors of our enemy are made.
                //This shootpoint block of code determines where our bullets will orginate from. In this case, the center of the enemy.
                shootpoint = new GameObject("Waterbuloncenter");
                shootpoint.transform.parent   = enemy.transform;
                shootpoint.transform.position = enemy.sprite.WorldCenter;
                GameObject position = enemy.transform.Find("Waterbuloncenter").gameObject;
                //this line adds a BehaviorSpeculator to our enemy which is the base for adding behaviors on to.
                var bs = prefab.GetComponent <BehaviorSpeculator>();
                //Here we will add some basic behaviors such as TargetPlayerBehavior and SeekTargetBehavior.
                //You can change many things in these behaviors so feel free to go nuts.
                BehaviorSpeculator BEHAVIORIAL = EnemyDatabase.GetOrLoadByGuid("0239c0680f9f467dbe5c4aab7dd1eca6").behaviorSpeculator;
                BehaviorSpeculator spec        = enemy.behaviorSpeculator;
                spec.OverrideBehaviors               = BEHAVIORIAL.OverrideBehaviors;
                spec.OtherBehaviors                  = BEHAVIORIAL.OtherBehaviors;
                spec.TargetBehaviors                 = BEHAVIORIAL.TargetBehaviors;
                spec.AttackBehaviors                 = BEHAVIORIAL.AttackBehaviors;
                spec.MovementBehaviors               = BEHAVIORIAL.MovementBehaviors;
                spec.InstantFirstTick                = BEHAVIORIAL.InstantFirstTick;
                spec.TickInterval                    = BEHAVIORIAL.TickInterval;
                spec.PostAwakenDelay                 = BEHAVIORIAL.PostAwakenDelay;
                spec.RemoveDelayOnReinforce          = BEHAVIORIAL.RemoveDelayOnReinforce;
                spec.OverrideStartingFacingDirection = BEHAVIORIAL.OverrideStartingFacingDirection;
                spec.StartingFacingDirection         = BEHAVIORIAL.StartingFacingDirection;
                spec.SkipTimingDifferentiator        = BEHAVIORIAL.SkipTimingDifferentiator;
                //Now this is one of the most important behaviors because it allows our enemy to shoot.
                bs.AttackBehaviors = new List <AttackBehaviorBase>()
                {
                    new ShootBehavior()
                    {
                        ShootPoint = position,
                        //This line selects our Bullet Script
                        BulletScript        = new CustomBulletScriptSelector(typeof(MiltonScript)),
                        LeadAmount          = 0f,
                        AttackCooldown      = 4f,
                        FireAnimation       = "attack",
                        RequiresLineOfSight = true,
                        Uninterruptible     = false,
                    }
                };
                bs.MovementBehaviors = new List <MovementBehaviorBase>
                {
                    new SeekTargetBehavior
                    {
                        StopWhenInRange     = false,
                        CustomRange         = 15f,
                        LineOfSight         = false,
                        ReturnToSpawn       = false,
                        SpawnTetherDistance = 0f,
                        PathInterval        = 0.5f,
                        SpecifyRange        = false,
                        MinActiveRange      = 0f,
                        MaxActiveRange      = 0f
                    }
                };
                //Adds the enemy to MTG spawn pool and spawn command
                Game.Enemies.Add("cak:waterbulon", enemy.aiActor);
            }
        }
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            GraphicsDevice.SamplerStates[0] = SamplerState.PointClamp;

            RigidBody.DebugLoadContent(GraphicsDevice, Content);
            DialogueRenderer.Instance.Initialize(Content, GraphicsDevice);

            manager = new GameObjectManager();

            GameObject camera = new GameObject();
            camera.AddTransform();
            //camera.Transform.Parent = player.Transform;
            camera.Transform.Position = new Vector2(0f, 30f);
            camera.Transform.Z = 80f;
            camera.AddCamera(GraphicsDevice.Viewport, true);
            camera.AddScript(new CameraScript(camera));
            manager.AddGameObject(camera);

            GameObject splash = SplashScript.CreateSplashGO(Content, GraphicsDevice);
            splash.Transform.Translate(new Vector3(-3000f, 0f, 10));
            manager.AddGameObject(splash);

            //GameObject cameraBounds = GameObject.CreateStaticGO(GraphicsDevice, Content.Load<Texture2D>("DebugCameraBounds"), SpriteTransparency.Transparent);
            //cameraBounds.Transform.Z = 0f;
            //cameraBounds.Transform.Parent = camera.Transform;
            //manager.AddGameObject(cameraBounds);

            // Main area
            GameObject mainLevel = WorldGen.CreateWorldGO(GraphicsDevice, Content, "Levels/LevelMainMid", "Levels/LevelMain");
            mainLevel.RigidBody.Body.Friction = 4f;
            manager.AddGameObject(mainLevel);
            GameObject mainLevelBack = GameObject.CreateStaticGO(GraphicsDevice, Content.Load<Texture2D>("Levels/LevelMainBack"), SpriteTransparency.Opaque);
            mainLevelBack.Transform.Z -= 25f;
            manager.AddGameObject(mainLevelBack);
            GameObject mainLevelFront = GameObject.CreateStaticGO(GraphicsDevice, Content.Load<Texture2D>("Levels/LevelMainFront"), SpriteTransparency.Transparent);
            mainLevelFront.Transform.Z = 5f;
            manager.AddGameObject(mainLevelFront);

            // Vent area
            GameObject vents = WorldGen.CreateWorldGO(GraphicsDevice, Content, "Levels/VentsMid", "Levels/Vents");
            vents.RigidBody.Body.Friction = 0f;
            vents.Transform.Position = new Vector2(2000f, 0f);
            manager.AddGameObject(vents);
            GameObject ventsTop1 = GameObject.CreateStaticGO(GraphicsDevice, Content.Load<Texture2D>("Levels/VentsTop1"), SpriteTransparency.Transparent);
            ventsTop1.Transform.Translate(new Vector3(2000f, 0f, 40f));
            manager.AddGameObject(ventsTop1);
            GameObject ventsTop2 = GameObject.CreateStaticGO(GraphicsDevice, Content.Load<Texture2D>("Levels/VentsTop2"), SpriteTransparency.Transparent);
            ventsTop2.Transform.Translate(new Vector3(2000f, 0f, 30f));
            manager.AddGameObject(ventsTop2);

            // Fans
            GameObject fan1 = FanScript.CreateFanGO(Content, GraphicsDevice);
            manager.AddGameObject(fan1);
            fan1.Transform.Translate(new Vector3(1855f, 180f, 0f));
            GameObject fan2 = FanScript.CreateFanGO(Content, GraphicsDevice);
            manager.AddGameObject(fan2);
            fan2.Transform.Translate(new Vector3(2272f, 256f, 0f));
            GameObject fan3 = FanScript.CreateFanGO(Content, GraphicsDevice);
            manager.AddGameObject(fan3);
            fan3.Transform.Translate(new Vector3(2016f, -208f, 0f));

            GameObject player = PlayerScript.CreatePlayerGO(Content, GraphicsDevice);
            player.Transform.Translate(new Vector3(-200f, -40f, 1f));
            //player.Transform.Translate(new Vector3(2385f, -420f, 1f));
            manager.AddGameObject(player);
            camera.Transform.Parent = player.Transform;

            PlayerScript playerScript = player.GetComponent<PlayerScript>();
            GameObject teleporter1 = TeleporterScript.CreateTeleporterGO(Content, playerScript, new Vector2(1604f, -332f), true);
            teleporter1.Transform.Translate(new Vector2(250f, -230f));
            manager.AddGameObject(teleporter1);
            GameObject teleporter2 = TeleporterScript.CreateTeleporterGO(Content, playerScript, new Vector2(-400f, 140f), false);
            teleporter2.Transform.Translate(new Vector2(1746f, 396f));
            manager.AddGameObject(teleporter2);
            GameObject teleporter3 = TeleporterScript.CreateTeleporterGO(Content, playerScript, new Vector2(2140f, 120f), true);
            teleporter3.Transform.Translate(new Vector2(330f, 140f));
            manager.AddGameObject(teleporter3);
            GameObject teleporter4 = TeleporterScript.CreateTeleporterGO(Content, playerScript, new Vector2(600f, 140f), false);
            teleporter4.Transform.Translate(new Vector2(2450f, 340f));
            manager.AddGameObject(teleporter4);
            GameObject teleporter5 = TeleporterScript.CreateTeleporterGO(Content, playerScript, new Vector2(1604f, -332f), true);
            teleporter5.Transform.Translate(new Vector2(800f, 140f));
            manager.AddGameObject(teleporter5);
            GameObject teleporter6 = TeleporterScript.CreateTeleporterGO(Content, playerScript, new Vector2(600f, -230f), false);
            teleporter6.Transform.Translate(new Vector2(2385f, -420f));
            manager.AddGameObject(teleporter6);

            GameObject tyson = ShankTargetScript.CreateTysonGO(Content, GraphicsDevice, playerScript);
            tyson.Transform.Translate(new Vector2(775f, 180f));
            manager.AddGameObject(tyson);

            //GameObject laser = LaserScript.CreateLaserGO(Content, GraphicsDevice);
            //manager.AddGameObject(laser);
            //laser.Transform.Translate(new Vector3(400f, 30f, 0f));

            //List<Vector2> patrolPoints = GuardScript.CreatePatrolPoints(200f, -50f, 300f, -50f, 400f, -50f, 500f, -50f);
            //GameObject guard = GuardScript.CreateGuardGO(Content, GraphicsDevice, patrolPoints);
            //guard.Transform.Translate(new Vector2(-300f, -50f));
            //manager.AddGameObject(guard);

            GameObject shank = ShankScript.CreateShankGO(Content, GraphicsDevice, (PlayerScript)player.GetComponent<PlayerScript>());
            manager.AddGameObject(shank);

            GameObject superStar = new GameObject();
            superStar.AddTransform();
            superStar.AddAudio();
            superStar.Audio.AddMusic(Content.Load<Song>("Sounds/Music/GuileTheme"));
            superStar.Transform.Translate(new Vector2(692f, -200f));
            superStar.AddAnimation(Content.Load<Texture2D>("Pickups/Superstar"), new Vector2(14f, 20f));
            superStar.Animation.AddAnimation("Idle", 0, 4);
            superStar.Animation.Play("Idle");
            superStar.AddRenderer(GraphicsDevice, SpriteTransparency.Transparent);
            superStar.AddTrigger(new Vector2(100f, 100f));
            superStar.AddScript(new EndScript(superStar));
            manager.AddGameObject(superStar);

            List<string> kkDi1 = new List<string>(11);
            kkDi1.Add("Who's out there?");
            kkDi1.Add("Just a man looking for his place in this cesspool.");
            kkDi1.Add("Well, this ain't no zoo so unless you gots anything for me then scram.");
            kkDi1.Add("What could an oversized turtle want in prison?");
            kkDi1.Add("Turtle!? When I have my koopas catch yo -");
            kkDi1.Add("You're minions couldn't catch a fat 3 foot tall plumber, even if they had wings.");
            kkDi1.Add("If my flying koopas in here hadn't had their wings pulled off by that damn Donkey Kong I'd have you before getting out of this cell.");
            kkDi1.Add("Ripping their wings off? Why'd he do that?");
            kkDi1.Add("That damn monkey was trying to muscle in on my woman. After Pauline disappeared he went after my princess before coming here. I put a hit on him but the damn monkey's too tough for my troopas. But when I'm out of this cell not only is he a dead chimp but I'll be busting out of here real soon.");
            kkDi1.Add("How do you intend on escaping the prison?");
            kkDi1.Add("None of your business. But if you bring me that primates head I might let you in on the plan.");
            List<string> kkCh1 = new List<string>(11);
            kkCh1.Add("Bowser");
            kkCh1.Add("Player");
            kkCh1.Add("Bowser");
            kkCh1.Add("Player");
            kkCh1.Add("Bowser");
            kkCh1.Add("Player");
            kkCh1.Add("Bowser");
            kkCh1.Add("Player");
            kkCh1.Add("Bowser");
            kkCh1.Add("Player");
            kkCh1.Add("Bowser");
            GameObject kkDGO1 = DialogueBoxScript.CreateDialogueAreaGO(kkDi1, kkCh1, new Vector2(96f, 64f));
            kkDGO1.Transform.Position = new Vector2(-415f, -220f);
            manager.AddGameObject(kkDGO1);

            List<string> gDi1 = new List<string>(11);
            gDi1.Add("Who dares to disturb me?");
            gDi1.Add("What exactly am I disturbing you from? You're alone in an empty cell.");
            gDi1.Add("Insolence! Once I escape from this cell I'll get you and Mike Tyson.");
            gDi1.Add("Mike Tyson? What's he got to do with you?");
            gDi1.Add("That Neanderthal has been trying to eat my ear.");
            gDi1.Add("Typical.");
            gDi1.Add("Once he's out of the way I'll be making my escape from this abysmal pit.");
            gDi1.Add("You know of a way to get out of this place?");
            gDi1.Add("Indeed. Once Mike Tyson is out of my way I'll make my glorious return to Hyrule.");
            gDi1.Add("How do you intend on escaping?");
            gDi1.Add("Lowly creature! If you do not have anything to offer me then why would I tell you? Kill Mike Tyson and I may divulge my plans to you.");
            List<string> gCh1 = new List<string>(11);
            gCh1.Add("Ganon");
            gCh1.Add("Player");
            gCh1.Add("Ganon");
            gCh1.Add("Player");
            gCh1.Add("Ganon");
            gCh1.Add("Player");
            gCh1.Add("Ganon");
            gCh1.Add("Player");
            gCh1.Add("Ganon");
            gCh1.Add("Player");
            gCh1.Add("Ganon");
            GameObject gDGO1 = DialogueBoxScript.CreateDialogueAreaGO(gDi1, gCh1, new Vector2(96f, 64f));
            gDGO1.Transform.Position = new Vector2(-190f, -220f);
            manager.AddGameObject(gDGO1);

            List<string> mbDi1 = new List<string>(14);
            mbDi1.Add("What the hell am I looking at?");
            mbDi1.Add("This one may be useful to me.");
            mbDi1.Add("I'm hearing voices in my head. That plumber hit me harder than I thought.");
            mbDi1.Add("I am Mother Brain, leader of the space pirates.");
            mbDi1.Add("I'm not really comfortable with people being in my head.");
            mbDi1.Add("My apologies, I do not have vocal cords or orifice to amplify sound vibrations in or-");
            mbDi1.Add("Please stop talking, it's hurting my brain.");
            mbDi1.Add("I only wish to make a proposition.");
            mbDi1.Add("Go on then?");
            mbDi1.Add("There is a man by the name of Doctor Wily who has challenged my pirates against his robot masters. I only seek his departure from this universe.");
            mbDi1.Add("You want him dead? What's in it for me?");
            mbDi1.Add("I can offer you freedom.");
            mbDi1.Add("How?");
            mbDi1.Add("Once this task is complete I will reveal the means of escape.");
            List<string> mbCh1 = new List<string>(14);
            mbCh1.Add("Player");
            mbCh1.Add("MotherBrain");
            mbCh1.Add("Player");
            mbCh1.Add("MotherBrain");
            mbCh1.Add("Player");
            mbCh1.Add("MotherBrain");
            mbCh1.Add("Player");
            mbCh1.Add("MotherBrain");
            mbCh1.Add("Player");
            mbCh1.Add("MotherBrain");
            mbCh1.Add("Player");
            mbCh1.Add("MotherBrain");
            mbCh1.Add("Player");
            mbCh1.Add("MotherBrain");
            GameObject mbDGO1 = DialogueBoxScript.CreateDialogueAreaGO(mbDi1, mbCh1, new Vector2(96f, 64f));
            mbDGO1.Transform.Position = new Vector2(45f, -220f);
            manager.AddGameObject(mbDGO1);

            List<string> dkDi = new List<string>(7);
            dkDi.Add("oooOOOAAHH!");
            dkDi.Add("Got you now Kong.");
            dkDi.Add("What is the meaning of this?");
            dkDi.Add("The monkey can talk?");
            dkDi.Add("Sir, this is an outrageous breach of my personal space. And, I'll have you know that I am of the Hominoidea family, therefore, I am an ape, not a monkey.");
            dkDi.Add("King Koopa sends his regards.");
            dkDi.Add("“Have at thee.");
            List<string> dkCh = new List<string>(7);
            dkCh.Add("DK");
            dkCh.Add("Player");
            dkCh.Add("DK");
            dkCh.Add("Player");
            dkCh.Add("DK");
            dkCh.Add("Player");
            dkCh.Add("DK");
            GameObject dkDGO = DialogueBoxScript.CreateDialogueAreaGO(dkDi, dkCh, new Vector2(240f, 112f));
            dkDGO.Transform.Position = new Vector2(700f, 170f);
            dkDGO.Trigger.Enabled = false;
            manager.AddGameObject(dkDGO);

            List<string> mtDi = new List<string>(5);
            mtDi.Add("Hey, what's going on here?");
            mtDi.Add("Your time has come champ.");
            mtDi.Add("Quit trying to scrutinize with my brain. I'm going to kick your ass.");
            mtDi.Add("You couldn't beat that punk ass Little Mac who was half your size.");
            mtDi.Add("I'ma eat your children son.");
            List<string> mtCh = new List<string>(5);
            mtCh.Add("Tyson");
            mtCh.Add("Player");
            mtCh.Add("Tyson");
            mtCh.Add("Player");
            mtCh.Add("Tyson");
            GameObject mtDGO = DialogueBoxScript.CreateDialogueAreaGO(mtDi, mtCh, new Vector2(50f, 112f));
            mtDGO.Transform.Position = new Vector2(620f, 170f);
            manager.AddGameObject(mtDGO);

            List<string> wDi = new List<string>(4);
            wDi.Add("What's going on here?");
            wDi.Add("Dr. Wily, your license's been revoked.");
            wDi.Add("License? I'm not a medical doctor.");
            wDi.Add("Shut it and die egghead.");
            List<string> wCh = new List<string>();
            wCh.Add("Wily");
            wCh.Add("Player");
            wCh.Add("Wily");
            wCh.Add("Player");
            GameObject wDGO = DialogueBoxScript.CreateDialogueAreaGO(wDi, wCh, new Vector2(240f, 112f));
            wDGO.Transform.Position = new Vector2(700f, 170f);
            wDGO.Trigger.Enabled = false;
            manager.AddGameObject(wDGO);
        }
        public static GameObject CreatePlayerGO(ContentManager content, GraphicsDevice gd)
        {
            if (characterSprite == null)
            {
                characterSprite = content.Load<Texture2D>("Characters/MainCharacter");
            }

            GameObject playerGO = new GameObject();
            playerGO.AddTransform();
            playerGO.AddAudio();
            playerGO.Audio.AddSFX("Pickup", content.Load<SoundEffect>("Sounds/PlayerSounds/Pickup"));
            playerGO.Audio.AddSFX("Shank", content.Load<SoundEffect>("Sounds/PlayerSounds/Shank"));
            playerGO.AddAnimation(characterSprite, new Vector2(28f, 30f));
            playerGO.Animation.AddAnimation("Idle", 0, 1);
            playerGO.Animation.AddAnimation("Run", 0, 4);
            playerGO.Animation.AddAnimation("Hide", 2, 1);
            playerGO.Animation.AddAnimation("Stab", 3, 1);
            playerGO.Animation.AddAnimation("Stealth", 1, 4);
            playerGO.Animation.AddAnimation("Elevator", 5, 1);
            playerGO.Animation.AddAnimation("VentIdle", 4, 1);
            playerGO.Animation.AddAnimation("VentCrawl", 4, 4);
            playerGO.AddRenderer(gd, SpriteTransparency.Transparent);
            playerGO.AddDynamicRigidBody(new Vector2(28f, 30f));
            playerGO.RigidBody.CollisionCategory = CollisionCats.PlayerCategory;
            playerGO.AddScript(new PlayerScript(playerGO));

            return playerGO;
        }
Пример #34
0
        public static void BuildPrefab()
        {
            bool flag = prefab != null || EnemyBuilder.Dictionary.ContainsKey(guid);

            bool flag2 = flag;

            if (!flag2)
            {
                prefab = EnemyBuilder.BuildPrefab("Hunter Kin", guid, "Items/Enemies/Sprites/Hunter_Kin/Idle_Front_Right/hunter_kin_idle_front_right_001", new IntVector2(0, 0), new IntVector2(0, 0), true, true);
                var enemy = prefab.AddComponent <EnemyBehavior>();

                enemy.aiActor.knockbackDoer.weight         = 35;
                enemy.aiActor.MovementSpeed                = 4f;
                enemy.aiActor.healthHaver.PreventAllDamage = false;
                enemy.aiActor.CollisionDamage              = 1f;
                enemy.aiActor.HasShadow                        = false;
                enemy.aiActor.IgnoreForRoomClear               = false;
                enemy.aiActor.aiAnimator.HitReactChance        = 0f;
                enemy.aiActor.specRigidbody.CollideWithOthers  = true;
                enemy.aiActor.specRigidbody.CollideWithTileMap = true;
                enemy.aiActor.PreventFallingInPitsEver         = false;
                enemy.aiActor.healthHaver.ForceSetCurrentHealth(25f);
                enemy.aiActor.CollisionKnockbackStrength = 5f;
                enemy.aiActor.CanTargetPlayers           = true;
                enemy.aiActor.healthHaver.SetHealthMaximum(25f, null, false);


                prefab.AddAnimation("idle_back_right", "Items/Enemies/Sprites/Hunter_Kin/Idle_Back_Right", fps: 5, AnimationType.Idle, DirectionType.FourWay);
                prefab.AddAnimation("idle_front_right", "Items/Enemies/Sprites/Hunter_Kin/Idle_Front_Right", fps: 5, AnimationType.Idle, DirectionType.FourWay);
                prefab.AddAnimation("idle_front_left", "Items/Enemies/Sprites/Hunter_Kin/Idle_Front_Left", fps: 5, AnimationType.Idle, DirectionType.FourWay);
                prefab.AddAnimation("idle_back_left", "Items/Enemies/Sprites/Hunter_Kin/Idle_Back_Left", fps: 5, AnimationType.Idle, DirectionType.FourWay);
                //
                prefab.AddAnimation("run_back_right", "Items/Enemies/Sprites/Hunter_Kin/Run_Back_Right", fps: 5, AnimationType.Move, DirectionType.FourWay);
                prefab.AddAnimation("run_front_right", "Items/Enemies/Sprites/Hunter_Kin/Run_Front_Right", fps: 5, AnimationType.Move, DirectionType.FourWay);
                prefab.AddAnimation("run_front_left", "Items/Enemies/Sprites/Hunter_Kin/Run_Front_Left", fps: 5, AnimationType.Move, DirectionType.FourWay);
                prefab.AddAnimation("run_back_left", "Items/Enemies/Sprites/Hunter_Kin/Run_Back_Left", fps: 5, AnimationType.Move, DirectionType.FourWay);
                //
                prefab.AddAnimation("die_north", "Items/Enemies/Sprites/Hunter_Kin/Die_North", fps: 5, AnimationType.Move, DirectionType.EightWayOrdinal, tk2dSpriteAnimationClip.WrapMode.Once, assignAnimation: false);
                prefab.AddAnimation("die_north_east", "Items/Enemies/Sprites/Hunter_Kin/Die_North_East", fps: 5, AnimationType.Move, DirectionType.EightWayOrdinal, tk2dSpriteAnimationClip.WrapMode.Once, assignAnimation: false);
                prefab.AddAnimation("die_east", "Items/Enemies/Sprites/Hunter_Kin/Die_East", fps: 5, AnimationType.Move, DirectionType.EightWayOrdinal, tk2dSpriteAnimationClip.WrapMode.Once, assignAnimation: false);
                prefab.AddAnimation("die_south_east", "Items/Enemies/Sprites/Hunter_Kin/Die_South_East", fps: 5, AnimationType.Move, DirectionType.EightWayOrdinal, tk2dSpriteAnimationClip.WrapMode.Once, assignAnimation: false);
                prefab.AddAnimation("die_south", "Items/Enemies/Sprites/Hunter_Kin/Die_South", fps: 5, AnimationType.Move, DirectionType.EightWayOrdinal, tk2dSpriteAnimationClip.WrapMode.Once, assignAnimation: false);
                prefab.AddAnimation("die_south_west", "Items/Enemies/Sprites/Hunter_Kin/Die_South_West", fps: 5, AnimationType.Move, DirectionType.EightWayOrdinal, tk2dSpriteAnimationClip.WrapMode.Once, assignAnimation: false);
                prefab.AddAnimation("die_west", "Items/Enemies/Sprites/Hunter_Kin/Die_West", fps: 5, AnimationType.Move, DirectionType.EightWayOrdinal, tk2dSpriteAnimationClip.WrapMode.Once, assignAnimation: false);
                prefab.AddAnimation("die_north_west", "Items/Enemies/Sprites/Hunter_Kin/Die_North_West", fps: 5, AnimationType.Move, DirectionType.EightWayOrdinal, tk2dSpriteAnimationClip.WrapMode.Once, assignAnimation: false);
                //
                prefab.AddAnimation("summon", "Items/Enemies/Sprites/Hunter_Kin/Summon", fps: 7, AnimationType.Move, DirectionType.Single, tk2dSpriteAnimationClip.WrapMode.Once, assignAnimation: false);

                DirectionalAnimation die = new DirectionalAnimation()
                {
                    AnimNames = new string[] { "die_north", "die_north_east", "die_east", "die_south_east", "die_south", "die_south_west", "die_west", "die_north_west" },
                    Flipped   = new FlipType[] { FlipType.None, FlipType.None, FlipType.None, FlipType.None, FlipType.None, FlipType.None, FlipType.None, FlipType.None, },
                    Type      = DirectionType.EightWayOrdinal,
                    Prefix    = string.Empty
                };
                DirectionalAnimation summon = new DirectionalAnimation()
                {
                    AnimNames = new string[] { "summon" },
                    Flipped   = new FlipType[] { FlipType.None },
                    Type      = DirectionType.Single,
                    Prefix    = string.Empty
                };

                enemy.aiAnimator.AssignDirectionalAnimation("die", die, AnimationType.Other);
                enemy.aiAnimator.AssignDirectionalAnimation("summon", summon, AnimationType.Other);
                enemy.aiActor.specRigidbody.PixelColliders.Clear();
                enemy.aiActor.specRigidbody.PixelColliders.Add(new PixelCollider
                {
                    ColliderGenerationMode = PixelCollider.PixelColliderGeneration.Manual,
                    CollisionLayer         = CollisionLayer.EnemyCollider,
                    IsTrigger = false,
                    BagleUseFirstFrameOnly = false,
                    SpecifyBagelFrame      = string.Empty,
                    BagelColliderNumber    = 0,
                    ManualOffsetX          = 0,
                    ManualOffsetY          = 0,
                    ManualWidth            = 14,
                    ManualHeight           = 24,
                    ManualDiameter         = 0,
                    ManualLeftX            = 0,
                    ManualLeftY            = 0,
                    ManualRightX           = 0,
                    ManualRightY           = 0
                });

                enemy.aiActor.specRigidbody.PixelColliders.Add(new PixelCollider
                {
                    ColliderGenerationMode = PixelCollider.PixelColliderGeneration.Manual,
                    CollisionLayer         = CollisionLayer.EnemyHitBox,
                    IsTrigger = false,
                    BagleUseFirstFrameOnly = false,
                    SpecifyBagelFrame      = string.Empty,
                    BagelColliderNumber    = 0,
                    ManualOffsetX          = 0,
                    ManualOffsetY          = 0,
                    ManualWidth            = 14,
                    ManualHeight           = 24,
                    ManualDiameter         = 0,
                    ManualLeftX            = 0,
                    ManualLeftY            = 0,
                    ManualRightX           = 0,
                    ManualRightY           = 0,
                });

                enemy.aiActor.PreventBlackPhantom = false;

                AIAnimator aiAnimator = enemy.aiAnimator;
                var        yah        = enemy.transform.Find("GunAttachPoint").gameObject;
                yah.transform.position      = enemy.aiActor.transform.position;
                yah.transform.localPosition = new Vector2(0f, .3f);
                AIActor SourceEnemy = EnemyDatabase.GetOrLoadByGuid("01972dee89fc4404a5c408d50007dad5");
                EnemyBuilder.DuplicateAIShooterAndAIBulletBank(prefab, SourceEnemy.aiShooter, SourceEnemy.GetComponent <AIBulletBank>(), 12, yah.transform);
                var bs = prefab.GetComponent <BehaviorSpeculator>();
                BehaviorSpeculator behaviorSpeculator = EnemyDatabase.GetOrLoadByGuid("01972dee89fc4404a5c408d50007dad5").behaviorSpeculator;

                bs.OverrideBehaviors = behaviorSpeculator.OverrideBehaviors;
                bs.OtherBehaviors    = behaviorSpeculator.OtherBehaviors;
                bs.TargetBehaviors   = new List <TargetBehaviorBase>
                {
                    new TargetPlayerBehavior
                    {
                        Radius              = 45f,
                        LineOfSight         = true,
                        ObjectPermanence    = true,
                        SearchInterval      = 0.25f,
                        PauseOnTargetSwitch = false,
                        PauseTime           = 0.25f
                    },
                };

                AIActor Firecracker = EnemyDatabase.GetOrLoadByGuid("5f15093e6f684f4fb09d3e7e697216b4");
                bs.AttackBehaviors = new List <AttackBehaviorBase>()
                {
                    new AttackBehaviorGroup()
                    {
                    }
                };

                bs.AttackBehaviorGroup.AttackBehaviors = new List <AttackBehaviorGroup.AttackGroupItem>()
                {
                    new AttackBehaviorGroup.AttackGroupItem()
                    {
                        Probability = 1.75f,
                        Behavior    = new ShootGunBehavior()
                        {
                            WeaponType              = WeaponType.BulletScript,
                            BulletScript            = new CustomBulletScriptSelector(typeof(HunterKinScript)),
                            LeadAmount              = 0,
                            LeadChance              = 1,
                            AttackCooldown          = 1f,
                            RequiresLineOfSight     = true,
                            FixTargetDuringAttack   = true,
                            StopDuringAttack        = true,
                            RespectReload           = true,
                            MagazineCapacity        = 5,
                            ReloadSpeed             = 1f,
                            EmptiesClip             = true,
                            SuppressReloadAnim      = false,
                            CooldownVariance        = 0,
                            GlobalCooldown          = 0,
                            InitialCooldown         = 0,
                            InitialCooldownVariance = 0,
                            GroupName                  = null,
                            GroupCooldown              = 0,
                            MinRange                   = 0,
                            Range                      = 7,
                            MinWallDistance            = 0,
                            MaxEnemiesInRoom           = -1,
                            MinHealthThreshold         = 0,
                            MaxHealthThreshold         = 1,
                            HealthThresholds           = new float[0],
                            AccumulateHealthThresholds = true,
                            targetAreaStyle            = null,
                            IsBlackPhantom             = false,
                            resetCooldownOnDamage      = null,
                            MaxUsages                  = 0,
                            UseLaserSight              = true,
                            PreFireLaserTime           = .5f,
                        },
                        NickName = "Hunter Kin Shoot Arrow"
                    },
                    new AttackBehaviorGroup.AttackGroupItem()
                    {
                        Probability = 1.5f,
                        Behavior    = new SummonEnemyBehavior()
                        {
                            DefineSpawnRadius    = true,
                            MinSpawnRadius       = 3,
                            MaxSpawnRadius       = 3,
                            MaxRoomOccupancy     = 6,
                            MaxSummonedAtOnce    = 2,
                            MaxToSpawn           = -1,
                            NumToSpawn           = 2,
                            KillSpawnedOnDeath   = false,
                            CrazeAfterMaxSpawned = false,
                            EnemeyGuids          = new List <string>()
                            {
                                BulletDog.guid
                            },
                            SummonTime          = .5f,
                            DisableDrops        = true,
                            StopDuringAnimation = true,
                            SummonAnim          = "Summon",
                            HideGun             = true,
                            Cooldown            = 1f,
                            RequiresLineOfSight = false,
                            selectionType       = SummonEnemyBehavior.SelectionType.Random,
                        },
                        NickName = "Summon dat doggy"
                    }
                };
                bs.MovementBehaviors = new List <MovementBehaviorBase>
                {
                    new SeekTargetBehavior
                    {
                        StopWhenInRange     = true,
                        CustomRange         = 7f,
                        LineOfSight         = false,
                        ReturnToSpawn       = false,
                        SpawnTetherDistance = 0f,
                        PathInterval        = 0.5f,
                        SpecifyRange        = false,
                        MinActiveRange      = 0f,
                        MaxActiveRange      = 0f
                    }
                };
                bs.InstantFirstTick                = behaviorSpeculator.InstantFirstTick;
                bs.TickInterval                    = behaviorSpeculator.TickInterval;
                bs.PostAwakenDelay                 = behaviorSpeculator.PostAwakenDelay;
                bs.RemoveDelayOnReinforce          = behaviorSpeculator.RemoveDelayOnReinforce;
                bs.OverrideStartingFacingDirection = behaviorSpeculator.OverrideStartingFacingDirection;
                bs.StartingFacingDirection         = behaviorSpeculator.StartingFacingDirection;
                bs.SkipTimingDifferentiator        = behaviorSpeculator.SkipTimingDifferentiator;
                Game.Enemies.Add("cel:hunter_kin", enemy.aiActor);
            }
        }