예제 #1
0
        // scroll through backpack modes
        public static void ScrollBackpack()
        {
            if (EmoteModMain.Settings.Backpack + 1 > 2)
            {
                SetBackpack(0);
            }
            else
            {
                SetBackpack(EmoteModMain.Settings.Backpack + 1);
            }

            switch (EmoteModMain.Settings.Backpack)
            {
            case 0:
                EmoteModMain.echo("backpack default");
                break;

            case 1:
                EmoteModMain.echo("backpack force on");
                break;

            case 2:
                EmoteModMain.echo("backpack force off");
                break;
            }
        }
예제 #2
0
 // playback mode
 public static void EnterSickoMode()
 {
     if (EmoteModMain.Settings.Backpack != 3)
     {
         SetBackpack(3);
         EmoteModMain.echo("W H I T E L I N E  A C T I V A T E D");
     }
     else
     {
         SetBackpack(0);
         EmoteModMain.echo("backpack default");
     }
 }
예제 #3
0
        // public static bool changedSprite;

        public static void Emote(string animation, bool by_command, Player player)
        {
            if (EmoteModMain.anim_by_game != 2)                 // if the game is not playing a cutscene
            {
                try                                             // anticrash3000
                {
                    player.StateMachine.State = Player.StDummy; // make player not able to move
                    player.DummyAutoAnimate   = false;          // make player not to auto animations
                    player.Speed = Vector2.Zero;                // stop the player

                    GravityModule.playerY = player.Y;           // record player y for the gravity switch

                    // if we were not doing an emote before, save default interactions state
                    if (EmoteModMain.anim_by_game == 0)
                    {
                        EmoteCancelModule.interactDefault      = EmoteModMain.celestenetSettings.Interactions; // (because if we record it during an emote its just going to be false)
                        EmoteCancelModule.invincibilityDefault = SaveData.Instance.Assists.Invincible;
                        SaveData.Instance.Assists.Invincible   = true;
                        // make playback emotes work
                        if (player.Sprite.Mode == PlayerSpriteMode.Playback)
                        {
                            playback = true;
                        }
                    }

                    // new sprite changes
                    if (!player.Sprite.Animations.ContainsKey(animation))
                    {
                        Dictionary <string, Sprite.Animation> .KeyCollection madeline_bp       = GFX.SpriteBank.SpriteData["player"].Sprite.Animations.Keys;
                        Dictionary <string, Sprite.Animation> .KeyCollection madeline_no_bp    = GFX.SpriteBank.SpriteData["player_no_backpack"].Sprite.Animations.Keys;
                        Dictionary <string, Sprite.Animation> .KeyCollection madeline_badeline = GFX.SpriteBank.SpriteData["player_badeline"].Sprite.Animations.Keys;
                        Dictionary <string, Sprite.Animation> .KeyCollection badeline          = GFX.SpriteBank.SpriteData["badeline"].Sprite.Animations.Keys;
                        Dictionary <string, Sprite.Animation> .KeyCollection madeline_playback = GFX.SpriteBank.SpriteData["player_playback"].Sprite.Animations.Keys;

                        // change sprite if animation not found
                        if (madeline_no_bp.Contains(animation, StringComparer.OrdinalIgnoreCase))
                        {
                            player.ResetSprite(PlayerSpriteMode.MadelineNoBackpack);
                        }
                        else if (badeline.Contains(animation, StringComparer.OrdinalIgnoreCase))
                        {
                            player.ResetSprite(PlayerSpriteMode.Badeline);
                        }
                        else if (madeline_bp.Contains(animation, StringComparer.OrdinalIgnoreCase))
                        {
                            player.ResetSprite(PlayerSpriteMode.Madeline);
                        }
                    }
                    // bounc e
                    if (animation == "bounce" || animation == "b")
                    {
                        if (!bounced)
                        {
                            GravityModule.playerY -= 1;
                        }
                        player.Sprite.Play("spin");
                        SpeedModule.currentDelay = player.Sprite.Animations["spin"].Delay;
                        bounced = true;
                    }
                    else
                    {
                        player.Sprite.Play(animation); // do emote
                        SpeedModule.currentDelay = player.Sprite.Animations[animation].Delay;
                    }

                    if (by_command) // command reply only if done by command
                    {
                        EmoteModMain.echo($"playing {animation}");
                    }

                    EmoteModMain.anim_by_game = 1; // acknowledge that emote is playing
                }
                catch (Exception e)
                {
                    Logger.Log("EmoteMod EXCEPTION", e.ToString()); // burh
                    EmoteModMain.echo($"failed to play {animation}");
                    EmoteCancelModule.cancelEmote();
                }
            }
        }
예제 #4
0
        public static void E(string custom, string emote)
        {
            if (!string.IsNullOrWhiteSpace(emote))
            {
                int customInt;
                int.TryParse(custom, out customInt);
                float emoteFloat; bool isFloat;
                isFloat = float.TryParse(emote, out emoteFloat);
                int emoteInt;
                int.TryParse(emote, out emoteInt);

                // this is where emotes should be
                if (custom == "c" || custom == "custom")                 // custom emotes
                {
                    EmoteModule.Emote(emote, true, PlayerModule.GetPlayer());
                }
                else if (custom == "toggle" || custom == "t")                 // toggles
                {
                    // toggle gravity
                    if (emote == "gravity" || emote == "g")
                    {
                        EmoteModMain.Settings.CancelGravity = !EmoteModMain.Settings.CancelGravity;
                        EmoteModMain.echo($"toggled gravity");
                        EmoteModMain.Instance.SaveSettings();
                        EmoteModMain.Instance.LoadSettings();
                    }
                    // print current animation
                    else if (emote == "i")
                    {
                        Engine.Commands.Log($"current animation: {PlayerModule.GetPlayer().Sprite.CurrentAnimationID}");
                    }
                    // print current state
                    else if (emote == "s")
                    {
                        Engine.Commands.Log(PlayerModule.GetPlayer().StateMachine.State);
                    }
                    // dump animations of current sprite mode to log file
                    else if (emote == "dump")
                    {
                        foreach (KeyValuePair <string, Sprite.Animation> animation in PlayerModule.GetPlayer().Sprite.Animations)
                        {
                            Logger.Log("ANIMAAAAAAAATIOOOOOOOONSSSSSSSSS", animation.Key);
                        }
                    }
                    // tobble backpack
                    else if (emote == "bp")
                    {
                        BackpackModule.ScrollBackpack();
                    }

                    // haha funny
                    else if (emote == "funnycommand" || emote == "fc")
                    {
                        BackpackModule.EnterSickoMode();
                    }
                }
                // binding emotes with console
                else if (int.TryParse(custom, out customInt) && customInt >= 0 && customInt <= 9)
                {
                    switch (customInt)
                    {
                    case 0:
                        EmoteModMain.Settings.emote0 = emote;
                        break;

                    case 1:
                        EmoteModMain.Settings.emote1 = emote;
                        break;

                    case 2:
                        EmoteModMain.Settings.emote2 = emote;
                        break;

                    case 3:
                        EmoteModMain.Settings.emote3 = emote;
                        break;

                    case 4:
                        EmoteModMain.Settings.emote4 = emote;
                        break;

                    case 5:
                        EmoteModMain.Settings.emote5 = emote;
                        break;

                    case 6:
                        EmoteModMain.Settings.emote6 = emote;
                        break;

                    case 7:
                        EmoteModMain.Settings.emote7 = emote;
                        break;

                    case 8:
                        EmoteModMain.Settings.emote8 = emote;
                        break;

                    case 9:
                        EmoteModMain.Settings.emote9 = emote;
                        break;
                    }
                    EmoteModMain.echo($"assigned {emote} to numpad {customInt}");
                    EmoteModMain.Instance.SaveSettings();
                    EmoteModMain.Instance.LoadSettings();
                }
                else if (custom == "d")
                {
                    try
                    {
                        Dictionary <string, SpriteData> spr = GFX.SpriteBank.SpriteData;
                        string anims = "";

                        if (emote == "modes")
                        {
                            foreach (KeyValuePair <string, SpriteData> anim in spr)
                            {
                                anims += anim.Key + " ";
                            }
                        }
                        else
                        {
                            foreach (KeyValuePair <string, Sprite.Animation> anim in spr[emote].Sprite.Animations)
                            {
                                anims += anim.Key + " ";
                            }
                        }

                        EmoteModMain.echo(anims);
                    }
                    catch
                    {
                        EmoteModMain.echo("something went wrong");
                    }
                }

                // the stretches

                else if (custom == "x" && int.TryParse(emote, out emoteInt))
                {
                    EmoteStretcher.stretch_x(emoteFloat);
                }
                else if (custom == "y" && int.TryParse(emote, out emoteInt))
                {
                    EmoteStretcher.stretch_y(emoteFloat);
                }
                else if (custom == "xy")
                {
                    if (emote == "lock" || emote == "l")
                    {
                        EmoteStretcher.lock_stretch();
                    }
                    else
                    {
                        EmoteStretcher.stretch_x(emoteFloat);
                        EmoteStretcher.stretch_y(emoteFloat);
                    }
                }

                else
                {
                    EmoteModMain.echo($"failed to execute e {custom} {emote}. check your spelling");
                }
            }
        }
예제 #5
0
 // i have no idea what is this for
 public EmoteModMain()
 {
     Instance = this;
 }