Ejemplo n.º 1
0
 private void TouchActionActivated(object sender, EventArgsAction e)
 {
     if (e.TouchAction && (e.ActionString == "PoolhouseEntry" || e.ActionString == "PoolEntrance"))
     {
         StaminaMngr.PoolhouseFlip();
     }
 }
Ejemplo n.º 2
0
 private void actionTriggered(object sender, EventArgsAction args)
 {
     if (args.Action == "SeedCatalogue")
     {
         openSeedCatalogue();
     }
 }
Ejemplo n.º 3
0
 private static void actionTriggered(object sender, EventArgsAction args)
 {
     string[] actionArgs = args.ActionString.Split(' ');
     if (args.Action == "MagicAltar")
     {
         if (!Game1.player.eventsSeen.Contains(90000))
         {
             Game1.drawObjectDialogue(Mod.instance.Helper.Translation.Get("altar.glow"));
         }
         else if (!Game1.player.knowsSchool(actionArgs[1]))
         {
             /*if (Game1.player.getSpellBook().knownSchools.Count >= Game1.player.countStardropsEaten() + 1)
              * {
              *  Game1.drawObjectDialogue("You lack the power to use this.");
              * }
              * else*/
             {
                 Game1.playSound("secret1");
                 Game1.player.getSpellBook().knownSchools.Add(actionArgs[1]);
                 Game1.drawObjectDialogue(Mod.instance.Helper.Translation.Get("altar.attuned", new { school = Mod.instance.Helper.Translation.Get($"school.{actionArgs[1]}.name") }));
             }
         }
         else
         {
             Game1.playSound("secret1");
             Game1.activeClickableMenu = new MagicMenu(School.getSchool(actionArgs[1]));
         }
     }
 }
Ejemplo n.º 4
0
 private void OnActionActivated(object sender, EventArgsAction e)
 {
     if (e.Action == "FireArcadeGame")
     {
         Game1.currentMinigame = new PyromancerMinigame();
     }
 }
Ejemplo n.º 5
0
 private static void actionTriggered(object sender, EventArgsAction args)
 {
     string[] actionArgs = args.ActionString.Split(' ');
     if (args.Action == "MagicAltar")
     {
         if (!Game1.player.eventsSeen.Contains(90000))
         {
             Game1.drawObjectDialogue("A glowing altar.");
         }
         else if (!Game1.player.knowsSchool(actionArgs[1]))
         {
             /*if (Game1.player.getSpellBook().knownSchools.Count >= Game1.player.countStardropsEaten() + 1)
              * {
              *  Game1.drawObjectDialogue("You lack the power to use this.");
              * }
              * else*/
             {
                 Game1.playSound("secret1");
                 Game1.player.getSpellBook().knownSchools.Add(actionArgs[1]);
                 Game1.drawObjectDialogue("You are now attuned to " + actionArgs[1] + ".");
             }
         }
         else
         {
             Game1.playSound("secret1");
             Game1.activeClickableMenu = new MagicMenu(School.getSchool(actionArgs[1]));
         }
     }
 }
Ejemplo n.º 6
0
 private static void OnTileAction(object sender, EventArgsAction e)
 {
     if (e.ActionString == "RSVMaiveLoan")
     {
         Log.Debug("MaiveLoan: In Touch Action event");
         RSVMaiveLoan("RSVMaiveLoan", Vector2.Zero);
     }
 }
Ejemplo n.º 7
0
 public static void HandleAction(object sender, EventArgsAction action)
 {
     if (action.Action.ToLower() == "warpnetwork")
     {
         ModEntry.monitor.Log("Warp Network Activated");
         string[] args = action.ActionString.Split(' ');
         ShowWarpMenu((args.Length > 1) ? args[1] : "");
     }
     if (action.Action.ToLower() == "warpnetworkto")
     {
         ModEntry.monitor.Log("Direct Warp Activated");
         string[] args = action.ActionString.Split(' ');
         DirectWarp(args);
     }
 }
Ejemplo n.º 8
0
 private static void actionTriggered(object sender, EventArgsAction args)
 {
     string[] actionArgs = args.ActionString.Split(' ');
     if (args.Action == "MagicAltar")
     {
         if (!Game1.player.eventsSeen.Contains(90001))
         {
             Game1.drawObjectDialogue(Mod.instance.Helper.Translation.Get("altar.glow"));
         }
         else
         {
             Game1.playSound("secret1");
             Game1.activeClickableMenu = new MagicMenu();// School.getSchool(actionArgs[1]));
         }
     }
 }
Ejemplo n.º 9
0
        private static void actionTriggered(object sender, EventArgsAction args)
        {
            string[] actionArgs = args.ActionString.Split(' ');
            if (args.Action == "MagicAltar")
            {
                if (Game1.player.eventsSeen.Contains(90001))
                {
                    // For testing
                    Game1.player.learnSpell("life2:meditate", 0, true);
                    Game1.player.learnSpell("transmutation:transmuteore", 0, true);
                    Game1.player.learnSpell("transmutation:transmutebar", 0, true);

                    Game1.player.addMana(Game1.player.getMaxMana());
                }
            }
        }
Ejemplo n.º 10
0
        private void onActionActivated(object sender, EventArgsAction e)
        {
            var farmer = sender as Farmer;

            if (e.ActionString == "Message \"FrostDungeon.Locked\"")
            {
                int key = ja.GetObjectId("Festive Key");
                if (farmer.ActiveObject?.ParentSheetIndex == key)
                {
                    farmer.removeFirstOfThisItemFromInventory(key);
                    farmer.mailReceived.Add("FrostDungeon.Locked." + farmer.currentLocation.doesTileHaveProperty((int)e.Position.X, (int)e.Position.Y, "Buildings", "UnlockId"));

                    var newAction = farmer.currentLocation.doesTileHaveProperty((int)e.Position.X, (int)e.Position.Y, "UnlockAction", "Buildings");
                    farmer.currentLocation.setTileProperty((int)e.Position.X, (int)e.Position.Y, "Buildings", "Action", newAction);
                    farmer.currentLocation.setMapTileIndex((int)e.Position.X, (int)e.Position.Y - 2, 48, "Buildings");

                    Game1.drawDialogueNoTyping(Game1.content.LoadString("Strings\\StringsFromMaps:FrostDungeon.Unlock"));
                    Game1.playSound("crystal");

                    e.Cancel = true;
                }
            }
            else if (e.Action == "ActivateArena")
            {
                if (farmer.currentLocation.Name == "FrostDungeon.Arena")
                {
                    Log.trace("Activate arena: Stage " + saveData.ArenaStage);
                    Game1.playSound("batScreech");
                    Game1.playSound("rockGolemSpawn");
                    if (saveData.ArenaStage == ArenaStage.NotTriggered)
                    {
                        saveData.ArenaStage = ArenaStage.Stage1;
                        for (int i = 0; i < 9; ++i)
                        {
                            int cx = (int)e.Position.X, cy = (int)e.Position.Y;
                            int dx = (int)(Math.Cos(Math.PI * 2 / 9 * i) * 5);
                            int dy = (int)(Math.Sin(Math.PI * 2 / 9 * i) * 5);
                            int x = cx + dx, y = cy + dy;
                            x *= Game1.tileSize;
                            y *= Game1.tileSize;

                            if (i % 3 == 0)
                            {
                                farmer.currentLocation.addCharacter(new Ghost(new Vector2(x, y)));
                            }
                            else if (i % 3 == 1)
                            {
                                farmer.currentLocation.addCharacter(new Skeleton(new Vector2(x, y)));
                            }
                            else if (i % 3 == 2)
                            {
                                farmer.currentLocation.addCharacter(new DustSpirit(new Vector2(x, y)));
                            }
                        }
                    }
                    else if (saveData.ArenaStage == ArenaStage.Finished1)
                    {
                        saveData.ArenaStage = ArenaStage.Stage2;
                        for (int i = 0; i < 3; ++i)
                        {
                            int cx = (int)e.Position.X, cy = (int)e.Position.Y;
                            int dx = (int)(Math.Cos(Math.PI * 2 / 3 * i) * 4);
                            int dy = (int)(Math.Sin(Math.PI * 2 / 3 * i) * 4);
                            int x = cx + dx, y = cy + dy;
                            x *= Game1.tileSize;
                            y *= Game1.tileSize;

                            if (i % 2 == 0)
                            {
                                farmer.currentLocation.addCharacter(new Bat(new Vector2(x, y), 77377));
                            }
                        }
                        farmer.currentLocation.addCharacter(new DinoMonster(new Vector2(9 * Game1.tileSize, 8 * Game1.tileSize)));
                    }
                }
            }
            else if (e.Action == "ItemPuzzle")
            {
                string[] toks = e.ActionString.Split(' ');
                int      item = int.Parse(toks[1]);
                if (farmer.ActiveObject?.ParentSheetIndex == item)
                {
                    farmer.removeFirstOfThisItemFromInventory(item);
                    farmer.currentLocation.removeTileProperty((int)e.Position.X, (int)e.Position.Y, "Buildings", "Action");

                    int warpIndex = farmer.currentLocation.Map.GetLayer("Buildings").Tiles[(int)e.Position.X, (int)e.Position.Y].TileIndex - 32;
                    var back      = farmer.currentLocation.Map.GetLayer("Back");
                    back.Tiles[(int)e.Position.X, (int)e.Position.Y + 3] = new StaticTile(back, farmer.currentLocation.Map.TileSheets[0], BlendMode.Additive, warpIndex);

                    var warp = new Warp((int)e.Position.X, (int)e.Position.Y + 3, toks[2], 7, 9, false);
                    farmer.currentLocation.warps.Add(warp);

                    Game1.playSound("secret1");
                }
                else
                {
                    Game1.drawDialogueNoTyping(Game1.content.LoadString("Strings\\StringsFromMaps:FrostDungeon.ItemPuzzle"));
                }
            }
            else if (e.Action == "BossKeyHalf")
            {
                string[] toks = e.ActionString.Split(' ');

                int key = ja.GetObjectId("Festive Big Key (" + toks[1] + ")");
                if (farmer.ActiveObject?.ParentSheetIndex == key)
                {
                    farmer.removeFirstOfThisItemFromInventory(key);

                    farmer.currentLocation.removeTile((int)e.Position.X, (int)e.Position.Y - 1, "Front");
                    farmer.currentLocation.removeTile((int)e.Position.X, (int)e.Position.Y, "Buildings");

                    Game1.playSound("secret1");

                    if (++bossKeysUsed >= 2)
                    {
                        var buildings = farmer.currentLocation.Map.GetLayer("Buildings");
                        int bx = 9, by = 4;
                        for (int i = 0; i < 4; ++i)
                        {
                            int ix = i % 2, iy = i / 2;
                            int x = bx + ix, y = by + iy;
                            buildings.Tiles[x, y].TileIndex += 2;

                            string prop = farmer.currentLocation.doesTileHaveProperty(x, y, "UnlockAction", "Buildings");
                            if (prop != null && prop != "")
                            {
                                farmer.currentLocation.setTileProperty(x, y, "Buildings", "Action", prop);
                            }
                        }
                    }
                }
            }
            else if (e.Action == "Movable")
            {
                int dir = farmer.FacingDirection;
                int ox = 0, oy = 0;
                switch (dir)
                {
                case 2: oy = 1; break;

                case 0: oy = -1; break;

                case 3: ox = -1; break;

                case 1: ox = 1; break;
                }

                int[] validPuzzleTiles = new int[]
                {
                    240, 241, 242, 243,
                    256, 257, 258, 259, 260,
                    272, 273, 274, 275, 276,
                };
                int target             = 243;

                int tx = (int)e.Position.X, ty = (int)e.Position.Y;
                while (true)
                {
                    tx += ox;
                    ty += oy;
                    if (!validPuzzleTiles.Contains(farmer.currentLocation.getTileIndexAt(tx, ty, "Back")) ||
                        farmer.currentLocation.doesTileHaveProperty(tx, ty, "Action", "Buildings") == "Movable")
                    {
                        tx -= ox;
                        ty -= oy;
                        break;
                    }
                }

                int currIndex = farmer.currentLocation.getTileIndexAt((int)e.Position.X, (int)e.Position.Y, "Buildings");
                farmer.currentLocation.removeTile((int)e.Position.X, (int)e.Position.Y, "Buildings");
                var buildings = farmer.currentLocation.Map.GetLayer("Buildings");
                buildings.Tiles[tx, ty] = new StaticTile(buildings, farmer.currentLocation.Map.TileSheets[0], BlendMode.Additive, currIndex);
                farmer.currentLocation.setTileProperty(tx, ty, "Buildings", "Action", "Movable");
                Game1.playSound("throw");

                if (farmer.currentLocation.getTileIndexAt(tx, ty, "Back") == target)
                {
                    var back = farmer.currentLocation.Map.GetLayer("Back");
                    back.Tiles[tx, ty] = new StaticTile(back, farmer.currentLocation.Map.TileSheets[0], BlendMode.Additive, 257);
                    var pos   = new Vector2(14, 13);
                    var chest = new Chest(0, new List <Item>(new Item[] { new StardewValley.Object(ja.GetObjectId("Festive Big Key (B)"), 1) }), pos);
                    farmer.currentLocation.overlayObjects[pos] = chest;
                    Game1.playSound("secret1");

                    for (int ix = 0; ix < back.LayerWidth; ++ix)
                    {
                        for (int iy = 0; iy < back.LayerHeight; ++iy)
                        {
                            if (farmer.currentLocation.doesTileHaveProperty(ix, iy, "Action", "Buildings") == "Movable")
                            {
                                farmer.currentLocation.removeTile(ix, iy, "Buildings");
                            }
                        }
                    }
                }
            }
        }