コード例 #1
0
        public static string Vault(string[] args, GameController ctrl)
        {
            float rotation = 0f;

            if (args.Length == 2)
            {
                float.TryParse(args[1], out rotation);
            }

            if (!Assets.Vaults.ContainsKey(args[0]))
            {
                return($"Vault {args[0]} does not exist.");
            }

            string ret;

            if (!Gen.Vault.TryBuild(args[0], ctrl.World.ActiveLevel,
                                    ctrl.Cursor.HoveredCell.Position, rotation))
            {
                ret = $"Failed to build vault {args[0]} at {ctrl.Cursor.HoveredCell.Position}.";
            }
            else
            {
                ret = $"Successfully built vault {args[0]} at {ctrl.Cursor.HoveredCell.Position}.";
            }

            FOV.RefreshFOV(ctrl.World.ActiveLevel, ctrl.PC.Cell, true);
            return(ret);
        }
コード例 #2
0
        public static string Relic(string[] args, GameController ctrl)
        {
            Entity relic = Gen.Relic.MakeRelic();

            relic.Move(ctrl.World.ActiveLevel, ctrl.Cursor.HoveredCell);
            FOV.RefreshFOV(ctrl.World.ActiveLevel, ctrl.PC.Cell, true);
            return($"Spawned {relic} at {ctrl.Cursor.HoveredCell}.");
        }
コード例 #3
0
 public static string KillLevel(string[] args, GameController ctrl)
 {
     foreach (Cell c in ctrl.World.ActiveLevel.Map)
     {
         if (c.Actor != null && !Actor.PlayerControlled(c.Actor))
         {
             c.Actor.Destroy(null);
         }
     }
     // TODO: Force dirty cell draw instead of FOV refresh
     FOV.RefreshFOV(ctrl.World.ActiveLevel, ctrl.PC.Cell, true);
     return($"Killed all NPCs in {ctrl.World.ActiveLevel}.");
 }
コード例 #4
0
        public static string Teleport(string[] args, GameController ctrl)
        {
            Cell cell = ctrl.Cursor.HoveredCell;

            if (Cell.Walkable(cell))
            {
                ctrl.PC.Move(ctrl.PC.Level, cell);
                FOV.RefreshFOV(ctrl.PC.Level, ctrl.PC.Cell, true);
                return($"Teleported player to {cell}.");
            }
            else
            {
                return("Targeted cell is not walkable.");
            }
        }