Пример #1
0
 void Awake()
 {
     if (Jail.Inst == null)
     {
         Inst = this;
     }
 }
Пример #2
0
 public override void Use()
 {
     if (_type == EnumsForCards.cardMove.directMove) //direct movement
     {
         Owner.Move(_move);
     }
     else if (_type == EnumsForCards.cardMove.closestUtility) //move to closest Utility. tile12, tile28
     {
         AdvClosestUtility();
     }
     else if (_type == EnumsForCards.cardMove.closestTrainStation) //move to closest train station. tile35, tile25, tile15, tile05
     {
         AdvClosestStation();
     }
     else if (_type == EnumsForCards.cardMove.moveBackThreeTiles)
     {
         int currPos = GetPlayerPosIndex();
         Owner.Move(GameManager.Tiles[currPos - 3]);
     }
     else // go to jail
     {
         Jail.GoToJail();
     }
     base.Use();
     GameManager.EndOfRollOptions();
 }
        public void testLandOnJailInJail()
        {
            Jail jailtesting = new Jail("Jail", true);
              Board.access().addPlayer(testPlayer);

              Assert.IsTrue(testPlayer.getJailStatis() == false);
        }
Пример #4
0
        public virtual Cell CreateCell(Enums.CellType method)
        {
            Cell cellType = null;

            switch (method)
            {
            case Enums.CellType.Hotel:
                cellType = new Hotel();
                break;

            case Enums.CellType.Jail:
                cellType = new Jail();
                break;

            case Enums.CellType.Lottery:
                cellType = new Lottery();
                break;

            case Enums.CellType.GoldHotel:
                cellType = new GoldHotel();
                break;

            case Enums.CellType.PlatinumHotel:
                cellType = new PlatinumHotel();
                break;

            default:
                break;
            }
            return(cellType);
        }
 public void testJail()
 {
     //create a instance of jail
     JailFactory T = new JailFactory();
     Jail p = T.create("jail",true);
     Type thisItem = new Jail().GetType();
     //Assert.IsInstanceOfType(thisItem, p);
 }
        public void testLandOnJailJustVisit()
        {
            Jail jailtesting = new Jail("Jail", false);
             Board.access().addPlayer(testPlayer);

             Assert.IsFalse(testPlayer.getJailStatis());
             jailtesting.landOn(ref testPlayer);
        }
Пример #7
0
        public ActionResult DeleteConfirmed(int id)
        {
            Jail jail = db.Jails.Find(id);

            db.Jails.Remove(jail);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Пример #8
0
        static void Main(string[] args)
        {
            Jail jail = new Jail();

            ServiceJail.MountJail(ref jail);

            Console.WriteLine(jail);

            //Console.WriteLine(killer.ToString());
        }
Пример #9
0
        //
        // GET: /Jail/Details/5

        public ActionResult Details(int id = 0)
        {
            Jail jail = db.Jails.Find(id);

            if (jail == null)
            {
                return(HttpNotFound());
            }
            return(View(jail));
        }
 public override void Use()
 {
     //makes sure player is in jail before they can use card
     if (Jail.InJail())
     {
         Jail.LeaveJail();
         base.Use();
         GameManager.EndOfRollOptions();
     }
 }
Пример #11
0
    public void GetIntoJail(Jail jail)
    {
        isInJail = true;

        Vector3 translate = jail.transform.position - transform.position;

        transform.Translate(translate);
        transform.position = new Vector3(transform.position.x, transform.position.y, -1);
        CurrentLocation    = jail.LocationIndex;
    }
Пример #12
0
        //
        // GET: /Jail/Edit/5

        public ActionResult Edit(int id = 0)
        {
            Jail jail = db.Jails.Find(id);

            if (jail == null)
            {
                return(HttpNotFound());
            }
            ViewBag.DistrictId = new SelectList(db.Districts, "DistrictId", "Name", jail.DistrictId);
            return(View(jail));
        }
Пример #13
0
 public ActionResult Edit(Jail jail)
 {
     if (ModelState.IsValid)
     {
         db.Entry(jail).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.DistrictId = new SelectList(db.Districts, "DistrictId", "Name", jail.DistrictId);
     return(View(jail));
 }
Пример #14
0
 public FormViewModel()
 {
     BailBondInfo     = new BailBondInfo();
     ProvidingAgency  = new ProvidingAgency();
     Jail             = new Jail();
     BondTransfer     = new BondTransfer();
     RequestingAgency = new RequestingAgency();
     Defendant        = new Defendant();
     Indemnitor       = new Indemnitor();
     AdditionalInfo   = new AdditionalInfo();
 }
Пример #15
0
        public ActionResult Create(Jail jail)
        {
            if (ModelState.IsValid)
            {
                db.Jails.Add(jail);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.DistrictId = new SelectList(db.Districts, "DistrictId", "Name", jail.DistrictId);
            return(View(jail));
        }
Пример #16
0
        public void RegisterJailedUser(string playerId, Jail jail, double time, string reason)
        {
            var jailTime = new JailTime()
            {
                PlayerId   = playerId,
                JailName   = jail.Name,
                ExpireDate = DateTime.Now.AddSeconds(time),
                Reason     = reason
            };

            Database.AddJailTime(jailTime);
            JailTimes[playerId] = DateTime.Now.AddSeconds(time);
        }
Пример #17
0
        private bool IsSpecial(Point3D location)
        {
            Region region = Server.Region.Find(location, Map.Felucca);

            if (region != null)
            {
                if (Jail.IsInSpecial(region.Name))
                {
                    return(true);
                }
            }
            return(false);
        }
Пример #18
0
        /// <summary>
        /// gets information that will be used in tooltips
        /// </summary>
        /// <returns></returns>
        public ObservableCollection <string> GetToolTipInfo()
        {
            ObservableCollection <string> info = new ObservableCollection <string>();

            Tile current = Board.Head;

            for (int i = 0; i < Board.Size; i++)
            {
                info.Add(current.GetCardInformation());
                current = current.NextTile;
            }
            info.Add(Jail.GetCardInformation());
            return(info);
        }
        public void TestLandOnJailJustVisiting()
        {
            Player playerone = new Player();

            Board theboard = new Board();

            Jail Visting = new Jail("visitng", false);
            Board.access().addPlayer(playerone);

            Board.access().addProperty(Visting);

            playerone.setLocation(10, false);

            Assert.IsTrue(Board.access().getPlayer(0).getJailStatis());
        }
Пример #20
0
 public static void NextPlayer()
 {
     _activeCard = null;
     _curPlayer  = _players[(Array.IndexOf(_players, _curPlayer) + 1) % _players.Length];
     if (Jail.InJail())
     {
         MenuManager.SwitchToMenuWithInventory(MenuManager.InJailTurnOptions);
     }
     else
     {
         MenuManager.SwitchToMenuWithInventory(MenuManager.TurnOptions);
     }
     //change the target for the camera to the current player
     CameraFollow.target = _curPlayer.transform;
     MenuManager.UpdateInventoryData();
 }
Пример #21
0
        public void Should_Compile_And_Run_Source_In_Sandbox()
        {
            var isolator    = new AppDomainIsolator();
            var environment = new DefaultEnvironment();

            var source = new CSharpSource("using System; using System.IO; namespace Foo { public class Bar { public int Greet() { return 42; } } }");

            environment.Register(source);

            using (var jail = Jail.Create(isolator, environment))
            {
                dynamic bar    = jail.Resolve("Foo.Bar");
                int     result = bar.Greet();

                Assert.AreEqual(42, result);
            }
        }
Пример #22
0
 public Board(int nP)
 {
     ArrayofSpace    = new Space[64];
     ArrayofSpace[0] = new Start();
     for (int i = 1; i < 64; i++)
     {
         if (i % 9 == 0)
         {
             ArrayofSpace[i] = new Beneficial();
         }
         if (i == 6)
         {
             ArrayofSpace[i] = new Bridge();
         }
         else if (i == 19)
         {
             ArrayofSpace[i] = new Hôtel();
         }
         else if (i == 31)
         {
             ArrayofSpace[i] = new Well();
         }
         else if (i == 42)
         {
             ArrayofSpace[i] = new Labyrinth();
         }
         else if (i == 52)
         {
             ArrayofSpace[i] = new Jail();
         }
         else if (i == 58)
         {
             ArrayofSpace[i] = new Death();
         }
         else if (i == 63)
         {
             ArrayofSpace[i] = new Win();
         }
         else
         {
             ArrayofSpace[i] = new Space();
         }
     }
 }
Пример #23
0
    /// <summary>
    /// Fromat the data list we've created using the CSV file to the Case format
    /// Each of the Tiles are inserted in the board
    /// </summary>
    public void InitiateBoard()
    {
        List <string[]> data = ReadFile();

        theBoard = new Case[40];
        for (int i = 0; i < 40; i++)
        {
            string[] row = data[i];
            if (row[1] == "J") //1 corresponding to column in csv where we can find the type of case
            {
                theBoard[i] = new Jail(Convert.ToInt32(row[0]), row[1], row[2]);
            }
            else if (row[1] == "P")
            {
                int[] prices = { Convert.ToInt32(row[3]), Convert.ToInt32(row[4]), Convert.ToInt32(row[5]), Convert.ToInt32(row[6]), Convert.ToInt32(row[7]), Convert.ToInt32(row[8]), Convert.ToInt32(row[9]), Convert.ToInt32(row[10]) };
                theBoard[i] = new Property(Convert.ToInt32(row[0]), row[1], row[2], prices);
            }
            else if (row[1] == "L")
            {
                theBoard[i] = new Chance(Convert.ToInt32(row[0]), row[1], row[2]);
            }
            else if (row[1] == "E")
            {
                theBoard[i] = new Community(Convert.ToInt32(row[0]), row[1], row[2]);
            }
            else if (row[1] == "G")
            {
                theBoard[i] = new Train(Convert.ToInt32(row[0]), row[1], row[2]);
            }
            else if (row[1] == "C")
            {
                theBoard[i] = new Companies(Convert.ToInt32(row[0]), row[1], row[2]);
            }
            else if (row[1] == "PG")
            {
                theBoard[i] = new FreeParking(Convert.ToInt32(row[0]), row[1], row[2]);
            }
            else
            {
                theBoard[i] = new OtherTiles(Convert.ToInt32(row[0]), row[1], row[2]);
            }
        }
    }
Пример #24
0
            public void Loads_And_Calculates_With_Dynamic_Proxy_In_Separate_AppDomain()
            {
                var isolator = new AppDomainIsolator();

                var environment = new DefaultEnvironment();

                environment.Register("Ext/Calculator.dll");

                using (var jail = Jail.Create(isolator, environment))
                {
                    dynamic calculator = jail.Resolve("Calculator.SimpleCalculator");
                    int     result     = calculator.Sum(new[] { 1, 2, 3, 4, 5 });
                    calculator.Name = "simple calculator";

                    Assert.AreEqual(15, result);
                    Assert.AreEqual("simple calculator", calculator.Name);
                }

                Assert.IsFalse(AppDomain.CurrentDomain.GetAssemblies().Any(asm => asm.GetName().Name == "Calculator"));
            }
Пример #25
0
 void Start()
 {
     players       = new GameObject[] { p1, p2 };
     logicPlayers  = new Players[] { p1.GetComponent <Players> (), p2.GetComponent <Players> () };
     currentPlayer = 0;
     spaces        = GameObject.Find("Spaces").GetComponentsInChildren <Transform> ();
     properties    = GameObject.Find("Spaces").GetComponentsInChildren <Property> ();
     trains        = GameObject.Find("Spaces").GetComponentsInChildren <Trains> ();
     services      = GameObject.Find("Spaces").GetComponentsInChildren <Services> ();
     chance        = GameObject.Find("Spaces/").GetComponentsInChildren <Chance> ();
     comunity      = GameObject.Find("Spaces/").GetComponentsInChildren <Comunity> ();
     freeplaces    = GameObject.Find("Spaces/").GetComponentsInChildren <Freeplaces> ();
     seniat        = GameObject.Find("Spaces/").GetComponentInChildren <Seniat> ();
     impuesto      = GameObject.Find("Spaces/").GetComponentInChildren <Impuesto> ();
     jail          = GameObject.Find("Spaces/").GetComponentInChildren <Jail> ();
     scenes        = new Scenes();
     dice          = GameObject.Find("/Canvas/Dice").GetComponent <Text>();
     turn          = GameObject.Find("/Canvas/Turn").GetComponent <Text>();
     info          = GameObject.Find("/Canvas/Info").GetComponent <Text>();
     StartCoroutine(Game());
 }
Пример #26
0
    // Update is called once per frame
    void Update()
    {
        velocity = rb.velocity;             //Set the velocity of the dice.

        if (Rolling)
        {
            //if still rolling, the dice numbers are set to 0, and so returns from function
            byte diceTotal = 0;
            foreach (Die die in dice)
            {
                if (die.number == 0)
                {
                    return;
                }
                diceTotal += die.number;
            }

            //set total
            _diceTotal = diceTotal;
            _rolling   = false;

            //checks if player is in jail or not
            if (!Jail.InJail())
            {
                GameManager.CurrentPlayer.Move((sbyte)Result);
            }
            else if (dice[0].number == dice[1].number)
            {
                Jail.LeaveJail();
                GameManager.CurrentPlayer.Move((sbyte)Result);
            }
            else
            {
                MenuManager.SwitchToMenuWithInventory(MenuManager.EndOfTurnOptions);
            }

            //set the camera to track the current player and enable end of roll options
            CameraFollow.target = GameManager.CurrentPlayer.transform;
        }
    }
Пример #27
0
        public static void Jail_OnCommand(KonsoleCommandEventArgs e)
        {
            if (e.Arguments.Length != 4)
            {
                ShowJailUsage();
                return;
            }

            if (HelperTools.IsNumeric(e.Arguments[1]) &&
                HelperTools.IsNumeric(e.Arguments[2]) &&
                HelperTools.IsNumeric(e.Arguments[3]))
            {
                //Validate player exists
                Character player = GetCharacterByName(e.Arguments[0]);
                if (player == null)
                {
                    Console.WriteLine("Could not find a character with the name: ", e.Arguments[0]);
                    ShowJailUsage();
                    return;
                }

                Jail.JailCharacter(player, int.Parse(e.Arguments[1]), int.Parse(e.Arguments[2]), int.Parse(e.Arguments[3]));
                Console.WriteLine(player.Name, " has been jailed!");

                //Some fun
                //HelperTools.BroadcastToAll("Admin is on a rampage! ", e.Arguments[0], " has been jailed!");

                if (player.Logged)
                {
                    player.SendMessage("You have been jailed!");
                }
            }
            else
            {
                Console.WriteLine("<d> <h> <m> parameters must be numeric");
                ShowJailUsage();
                return;
            }
        }
Пример #28
0
        public static void MountJail(ref Jail jail)
        {
            HashSet <Block>          bloks           = new HashSet <Block>();
            HashSet <StructureBlock> structureBlocks = new HashSet <StructureBlock>();
            StructureBlock           structureBlock  = new StructureBlock();
            Character character;


            character = FactoryCharacters.CreateCharacter("Jose", "JZ", EnumCharacters.Thief);

            structureBlock = FactoryStructureBlock.CreateStructureBlock(EnumStructureBlocks.Hall);
            structureBlock.Characters.Add(character);

            structureBlocks.Add(structureBlock);
            structureBlocks.Add(FactoryStructureBlock.CreateStructureBlock(EnumStructureBlocks.Saddle));
            structureBlocks.Add(FactoryStructureBlock.CreateStructureBlock(EnumStructureBlocks.Saddle));
            structureBlocks.Add(FactoryStructureBlock.CreateStructureBlock(EnumStructureBlocks.Saddle));
            structureBlocks.Add(FactoryStructureBlock.CreateStructureBlock(EnumStructureBlocks.Saddle));

            bloks.Add(CreateBloks(1, structureBlocks));

            jail = new Jail("hell", 10, "são tomé e príncipe", bloks);
        }
Пример #29
0
        static Deck <Card> InitializeCard() // A REVOIR
        {
            List <CardRepartition> cardRepartition = ISerialize.Deserialize <List <CardRepartition> >(@"_Datas/Cards.json");

            Deck <Card> cards = new Deck <Card>();

            foreach (CardRepartition CR in cardRepartition)
            {
                for (int i = 0; i < CR.number; i++)
                {
                    switch (CR.type)
                    {
                    case CardType.Bang:
                        Bang b = new Bang("Bang", (Couleur)rand.Next(0, 4), (Value)rand.Next(0, 13), Cible.APorteeDeTire, "Enlève un point de vie à un joueur à porté de tir", -1);
                        cards.Add(b);
                        break;

                    case CardType.Discard:
                        Discard d = new Discard("Discard", (Couleur)rand.Next(0, 4), (Value)rand.Next(0, 13), Cible.SoiMeme, "Fait échouer un Bang", -1);
                        cards.Add(d);
                        break;

                    case CardType.Draw:
                        Draw dd = new Draw("Draw", (Couleur)rand.Next(0, 4), (Value)rand.Next(0, 13), Cible.SoiMeme, "Pioche 2 cartes", -1);
                        cards.Add(dd);
                        break;

                    case CardType.Duel:
                        Duel ddd = new Duel("Duel", (Couleur)rand.Next(0, 4), (Value)rand.Next(0, 13), Cible.NimporteQui, "Provoque un duel", -1);
                        cards.Add(ddd);
                        break;

                    case CardType.Heal:
                        Heal h = new Heal("Heal", (Couleur)rand.Next(0, 4), (Value)rand.Next(0, 13), Cible.NimporteQui, "Soigne un point de vie", -1);
                        cards.Add(h);
                        break;

                    case CardType.Miss:
                        Miss m = new Miss("Miss", (Couleur)rand.Next(0, 4), (Value)rand.Next(0, 13), Cible.SoiMeme, "Esquive un Bang", -1);
                        cards.Add(m);
                        break;

                    case CardType.Jail:
                        Jail j = new Jail("Jail", (Couleur)rand.Next(0, 4), (Value)rand.Next(0, 13), Cible.NimporteQui, "Emprisonne quelqu'un");
                        cards.Add(j);
                        break;

                    case CardType.ModRange:
                        ModRange mr = new ModRange("Mustang", (Couleur)rand.Next(0, 4), (Value)rand.Next(0, 13), Cible.SoiMeme, "Distance +1 pour les autres joueurs");
                        cards.Add(mr);
                        break;

                    case CardType.Stash:
                        Stash s = new Stash("Stash", (Couleur)rand.Next(0, 4), (Value)rand.Next(0, 13), Cible.SoiMeme, "Quand Bang reçu, piocher une carte, si coeur alors esquive");
                        cards.Add(s);
                        break;

                    case CardType.Weapon:
                        Weapon w = new Weapon("Pistoulet", (Couleur)rand.Next(0, 4), (Value)rand.Next(0, 13), Cible.SoiMeme, "Augmente la porté de 1");
                        cards.Add(w);
                        break;

                    default:
                        break;
                    }
                }
            }

            cards.Shuffle();

            return(cards);
        }
Пример #30
0
 public static void Load()
 {
     PersistentOperations.SetInstallFolder();
     if (!DiscordBot.TokenLoaded)
     {
         DiscordBot.BuildToken();
     }
     if (!RunTimePatch.Applied)
     {
         RunTimePatch.PatchAll();
     }
     if (!Timers.IsRunning)
     {
         Timers.TimerStart();
     }
     if (!Triggers.IsRunning)
     {
         Triggers.Load();
     }
     if (Poll.IsEnabled && PersistentContainer.Instance.PollOpen)
     {
         Poll.CheckTime();
     }
     if (!ClanManager.IsEnabled)
     {
         ClanManager.Clans.Clear();
         ClanManager.ClanMember.Clear();
     }
     if (!InfoTicker.IsEnabled && InfoTicker.IsRunning)
     {
         InfoTicker.Unload();
     }
     if (InfoTicker.IsEnabled && !InfoTicker.IsRunning)
     {
         InfoTicker.Load();
     }
     if (Gimme.IsRunning && !Gimme.IsEnabled)
     {
         Gimme.Unload();
     }
     if (!Gimme.IsRunning && Gimme.IsEnabled)
     {
         Gimme.Load();
     }
     if (Badwords.IsRunning && !Badwords.IsEnabled)
     {
         Badwords.Unload();
     }
     if (!Badwords.IsRunning && Badwords.IsEnabled)
     {
         Badwords.Load();
     }
     if (!LoginNotice.IsRunning && LoginNotice.IsEnabled)
     {
         LoginNotice.Load();
     }
     if (LoginNotice.IsRunning && !LoginNotice.IsEnabled)
     {
         LoginNotice.Unload();
     }
     if (!Zones.IsRunning && Zones.IsEnabled)
     {
         Zones.Load();
     }
     if (Zones.IsRunning && !Zones.IsEnabled)
     {
         Zones.Unload();
     }
     if (!VoteReward.IsRunning && VoteReward.IsEnabled)
     {
         VoteReward.Load();
     }
     if (VoteReward.IsRunning && !VoteReward.IsEnabled)
     {
         VoteReward.Unload();
     }
     if (!Watchlist.IsRunning && Watchlist.IsEnabled)
     {
         Watchlist.Load();
     }
     if (Watchlist.IsRunning && !Watchlist.IsEnabled)
     {
         Watchlist.Unload();
     }
     if (!ReservedSlots.IsRunning && ReservedSlots.IsEnabled)
     {
         ReservedSlots.Load();
     }
     if (ReservedSlots.IsRunning && !ReservedSlots.IsEnabled)
     {
         ReservedSlots.Unload();
     }
     if (!StartingItems.IsRunning && StartingItems.IsEnabled)
     {
         StartingItems.Load();
     }
     if (StartingItems.IsRunning && !StartingItems.IsEnabled)
     {
         StartingItems.Unload();
     }
     if (!Travel.IsRunning && Travel.IsEnabled)
     {
         Travel.Load();
     }
     if (Travel.IsRunning && !Travel.IsEnabled)
     {
         Travel.Unload();
     }
     if (!Shop.IsRunning && Shop.IsEnabled)
     {
         Shop.Load();
     }
     if (Shop.IsRunning && !Shop.IsEnabled)
     {
         Shop.Unload();
     }
     if (!Motd.IsRunning && Motd.IsEnabled)
     {
         Motd.Load();
     }
     if (Motd.IsRunning && !Motd.IsEnabled)
     {
         Motd.Unload();
     }
     if (InvalidItems.IsRunning && !InvalidItems.IsEnabled)
     {
         InvalidItems.Unload();
     }
     if (!InvalidItems.IsRunning && InvalidItems.IsEnabled)
     {
         InvalidItems.Load();
     }
     if (HighPingKicker.IsRunning && !HighPingKicker.IsEnabled)
     {
         HighPingKicker.Unload();
     }
     if (!HighPingKicker.IsRunning && HighPingKicker.IsEnabled)
     {
         HighPingKicker.Load();
     }
     if (CredentialCheck.IsRunning && !CredentialCheck.IsEnabled)
     {
         CredentialCheck.Unload();
     }
     if (!CredentialCheck.IsRunning && CredentialCheck.IsEnabled)
     {
         CredentialCheck.Load();
     }
     if (CustomCommands.IsRunning && !CustomCommands.IsEnabled)
     {
         CustomCommands.Unload();
     }
     if (!CustomCommands.IsRunning && CustomCommands.IsEnabled)
     {
         CustomCommands.Load();
     }
     if (DupeLog.IsRunning && !DupeLog.IsEnabled)
     {
         DupeLog.Unload();
     }
     if (!DupeLog.IsRunning && DupeLog.IsEnabled)
     {
         DupeLog.Load();
     }
     if (ChatColorPrefix.IsRunning && !ChatColorPrefix.IsEnabled)
     {
         ChatColorPrefix.Unload();
     }
     if (!ChatColorPrefix.IsRunning && ChatColorPrefix.IsEnabled)
     {
         ChatColorPrefix.Load();
     }
     if (KillNotice.IsRunning && !KillNotice.IsEnabled)
     {
         KillNotice.Unload();
     }
     if (!KillNotice.IsRunning && KillNotice.IsEnabled)
     {
         KillNotice.Load();
     }
     if (Prayer.IsRunning && !Prayer.IsEnabled)
     {
         Prayer.Unload();
     }
     if (!Prayer.IsRunning && Prayer.IsEnabled)
     {
         Prayer.Load();
     }
     if (BloodmoonWarrior.IsRunning && !BloodmoonWarrior.IsEnabled)
     {
         BloodmoonWarrior.Unload();
     }
     else if (!BloodmoonWarrior.IsRunning && BloodmoonWarrior.IsEnabled)
     {
         BloodmoonWarrior.Load();
     }
     if (ProtectedSpaces.IsRunning && !ProtectedSpaces.IsEnabled)
     {
         ProtectedSpaces.Unload();
     }
     else if (!ProtectedSpaces.IsRunning && ProtectedSpaces.IsEnabled)
     {
         ProtectedSpaces.Load();
     }
     if (ClanManager.IsEnabled)
     {
         ClanManager.ClanList();
     }
     if (Auction.IsEnabled)
     {
         Auction.AuctionList();
     }
     if (Mute.IsEnabled)
     {
         Mute.ClientMuteList();
         Mute.MuteList();
     }
     if (Jail.IsEnabled)
     {
         Jail.JailList();
     }
     if (WebAPI.IsEnabled && !WebAPI.IsRunning)
     {
         WebAPI.Load();
     }
     else if (WebAPI.IsRunning && !WebAPI.IsEnabled)
     {
         WebAPI.Unload();
     }
 }
Пример #31
0
 public static void Load()
 {
     DiscordBot.BuildToken();
     if (!Timers.CoreIsRunning)
     {
         Timers.CoreTimerStart();
     }
     if (XRayDetector.IsEnabled && !Timers.HalfSecondIsRunning)
     {
         Timers.HalfSecondTimerStart();
     }
     if (!XRayDetector.IsEnabled && Timers.HalfSecondIsRunning)
     {
         Timers.HalfSecondTimerStop();
     }
     if (Poll.IsEnabled && PersistentContainer.Instance.PollOpen)
     {
         Poll.CheckTime();
     }
     if (!ClanManager.IsEnabled)
     {
         ClanManager.Clans.Clear();
         ClanManager.ClanMember.Clear();
     }
     if (!InfoTicker.IsEnabled && InfoTicker.IsRunning)
     {
         InfoTicker.Unload();
     }
     if (InfoTicker.IsEnabled && !InfoTicker.IsRunning)
     {
         InfoTicker.Load();
     }
     if (Gimme.IsRunning && !Gimme.IsEnabled)
     {
         Gimme.Unload();
     }
     if (!Gimme.IsRunning && Gimme.IsEnabled)
     {
         Gimme.Load();
     }
     if (Badwords.IsRunning && !Badwords.IsEnabled)
     {
         Badwords.Unload();
     }
     if (!Badwords.IsRunning && Badwords.IsEnabled)
     {
         Badwords.Load();
     }
     if (!LoginNotice.IsRunning && LoginNotice.IsEnabled)
     {
         LoginNotice.Load();
     }
     if (LoginNotice.IsRunning && !LoginNotice.IsEnabled)
     {
         LoginNotice.Unload();
     }
     if (!Zones.IsRunning && Zones.IsEnabled)
     {
         Zones.Load();
     }
     if (Zones.IsRunning && !Zones.IsEnabled)
     {
         Zones.Unload();
     }
     if (!VoteReward.IsRunning && VoteReward.IsEnabled)
     {
         VoteReward.Load();
     }
     if (VoteReward.IsRunning && !VoteReward.IsEnabled)
     {
         VoteReward.Unload();
     }
     if (!WatchList.IsRunning && WatchList.IsEnabled)
     {
         WatchList.Load();
     }
     if (WatchList.IsRunning && !WatchList.IsEnabled)
     {
         WatchList.Unload();
     }
     if (!ReservedSlots.IsRunning && ReservedSlots.IsEnabled)
     {
         ReservedSlots.Load();
     }
     if (ReservedSlots.IsRunning && !ReservedSlots.IsEnabled)
     {
         ReservedSlots.Unload();
     }
     if (!StartingItems.IsRunning && StartingItems.IsEnabled)
     {
         StartingItems.Load();
     }
     if (StartingItems.IsRunning && !StartingItems.IsEnabled)
     {
         StartingItems.Unload();
     }
     if (!Travel.IsRunning && Travel.IsEnabled)
     {
         Travel.Load();
     }
     if (Travel.IsRunning && !Travel.IsEnabled)
     {
         Travel.Unload();
     }
     if (!Shop.IsRunning && Shop.IsEnabled)
     {
         Shop.Load();
     }
     if (Shop.IsRunning && !Shop.IsEnabled)
     {
         Shop.Unload();
     }
     if (!Motd.IsRunning && Motd.IsEnabled)
     {
         Motd.Load();
     }
     if (Motd.IsRunning && !Motd.IsEnabled)
     {
         Motd.Unload();
     }
     if (InvalidItems.IsRunning && !InvalidItems.IsEnabled)
     {
         InvalidItems.Unload();
     }
     if (!InvalidItems.IsRunning && InvalidItems.IsEnabled)
     {
         InvalidItems.Load();
     }
     if (HighPingKicker.IsRunning && !HighPingKicker.IsEnabled)
     {
         HighPingKicker.Unload();
     }
     if (!HighPingKicker.IsRunning && HighPingKicker.IsEnabled)
     {
         HighPingKicker.Load();
     }
     if (CustomCommands.IsRunning && !CustomCommands.IsEnabled)
     {
         CustomCommands.Unload();
     }
     if (!CustomCommands.IsRunning && CustomCommands.IsEnabled)
     {
         CustomCommands.Load();
     }
     if (DupeLog.IsRunning && !DupeLog.IsEnabled)
     {
         DupeLog.Unload();
     }
     if (!DupeLog.IsRunning && DupeLog.IsEnabled)
     {
         DupeLog.Load();
     }
     if (ChatColor.IsRunning && !ChatColor.IsEnabled)
     {
         ColorList.Unload();
         ChatColor.Unload();
     }
     if (!ChatColor.IsRunning && ChatColor.IsEnabled)
     {
         ColorList.Load();
         ChatColor.Load();
     }
     if (KillNotice.IsRunning && !KillNotice.IsEnabled)
     {
         KillNotice.Unload();
     }
     if (!KillNotice.IsRunning && KillNotice.IsEnabled)
     {
         KillNotice.Load();
     }
     if (Prayer.IsRunning && !Prayer.IsEnabled)
     {
         Prayer.Unload();
     }
     if (!Prayer.IsRunning && Prayer.IsEnabled)
     {
         Prayer.Load();
     }
     if (BloodmoonWarrior.IsRunning && !BloodmoonWarrior.IsEnabled)
     {
         BloodmoonWarrior.Unload();
     }
     else if (!BloodmoonWarrior.IsRunning && BloodmoonWarrior.IsEnabled)
     {
         BloodmoonWarrior.Load();
     }
     if (Waypoints.IsRunning && !Waypoints.Public_Waypoints)
     {
         Waypoints.Unload();
     }
     else if (!Waypoints.IsRunning && Waypoints.Public_Waypoints)
     {
         Waypoints.Load();
     }
     if (LevelUp.IsRunning && !LevelUp.IsEnabled)
     {
         LevelUp.Unload();
     }
     else if (!LevelUp.IsRunning && LevelUp.IsEnabled)
     {
         LevelUp.Load();
     }
     if (BotResponse.IsRunning && !BotResponse.IsEnabled)
     {
         BotResponse.Unload();
     }
     else if (!BotResponse.IsRunning && BotResponse.IsEnabled)
     {
         BotResponse.Load();
     }
     if (ProtectedZones.IsRunning && !ProtectedZones.IsEnabled)
     {
         ProtectedZones.Unload();
     }
     else if (!ProtectedZones.IsRunning && ProtectedZones.IsEnabled)
     {
         ProtectedZones.Load();
     }
     if (ClanManager.IsEnabled)
     {
         ClanManager.ClanList();
     }
     if (Auction.IsEnabled)
     {
         Auction.AuctionList();
     }
     if (Mute.IsEnabled)
     {
         Mute.ClientMuteList();
         Mute.MuteList();
     }
     if (Jail.IsEnabled)
     {
         Jail.JailList();
     }
     if (WebAPI.IsEnabled && !WebAPI.IsRunning)
     {
         if (!PersistentOperations.ThirtySeconds)
         {
             Log.Out("[SERVERTOOLS] Web_API will go live thirty seconds after the server finishes loading");
         }
         else
         {
             WebAPI.Load();
         }
     }
     else if (WebAPI.IsRunning && !WebAPI.IsEnabled)
     {
         WebAPI.Unload();
     }
 }
Пример #32
0
    public static void CallTradingButtonListener(Button button)
    {
        if (button == Back)
        {
            //destroy previous cards
            if (TradingOptions.enabled == true)
            {
                foreach (GameObject cardObj in GameObject.FindGameObjectsWithTag("InventoryCard"))
                {
                    GameObject.Destroy(cardObj);
                }
                MenuManager.SwitchToMenu(TradingSetup);
                MenuManager.ShowMenu(BackFromTradingOptions);
            }
            else if (Jail.InJail())
            {
                MenuManager.SwitchToMenuWithInventory(MenuManager.InJailTurnOptions);
            }
            else
            {
                MenuManager.SwitchToMenuWithInventory(MenuManager.TurnOptions);
            }

            _tradee = null;
            //prevent memory leaks
            Resources.UnloadUnusedAssets();
        }
        else if (button == Offer && !(MenuManager.ButtonClicked && ((Tradee.gameObject.GetComponent <AI>() != null && CounterOfferInProgress) ||
                                                                    (GameManager.CurrentPlayer.gameObject.GetComponent <AI>() != null && !CounterOfferInProgress))))
        {
            Text text = Offer.GetComponentInChildren <Text>();
            text.text = text.text == "Offer" ? "CounterOffer" : "Offer";

            _counterOffer       = !_counterOffer;
            Accept.interactable = true;
            Back.interactable   = !Back.interactable;

            UpdateCardsInTrade();
            Offer.interactable = false;
        }
        else if (button == Accept && !(MenuManager.ButtonClicked && ((Tradee.gameObject.GetComponent <AI>() != null && CounterOfferInProgress) ||
                                                                     (GameManager.CurrentPlayer.gameObject.GetComponent <AI>() != null && !CounterOfferInProgress))))
        {
            foreach (Property property in _playerOffer)
            {
                GameManager.CurrentPlayer.RemoveProperty(property);
                Tradee.AddProperty(property);
            }
            foreach (Property property in _tradeeOffer)
            {
                Tradee.RemoveProperty(property);
                GameManager.CurrentPlayer.AddProperty(property);
            }

            _tradee = null;
            if (Jail.InJail())
            {
                MenuManager.SwitchToMenuWithInventory(MenuManager.InJailTurnOptions);
            }
            else
            {
                MenuManager.SwitchToMenuWithInventory(MenuManager.TurnOptions);
            }
        }
        else if (Array.IndexOf(TradingPartnerOptions, button) != -1)
        {
            //set tradee to selected player
            foreach (Player player in GameManager.Players)
            {
                if (player.gameObject.name == button.GetComponentInChildren <Text>().text)
                {
                    _tradee = player;
                    break;
                }
            }

            //reset offer lists
            _tradeeOffer = new List <Property>();
            _playerOffer = new List <Property>();

            MenuManager.SwitchToMenu(TradingOptions);
            MenuManager.ShowMenu(BackFromTradingOptions);

            _counterOffer       = false;
            Accept.interactable = false;
            Offer.GetComponentInChildren <Text>().text = "Offer";

            UpdateCardsInTrade();
            Offer.interactable = false;
        }
    }
    // 10
    void Wheel_GoToJail(Player player)
    {
        Jail jail = FindObjectOfType <Jail>();

        player.GetIntoJail(jail);
    }
Пример #34
0
    private void OnTriggerEnter(Collider other)
    {
        // если прожектайл столкнулся с препятствием - возвращаем в пул
        if (other.tag == "Obstacles")
        {
            transform.SetParent(main.rocketsPool);
            flying = false;
        }
        else if (other.tag == "Jail")
        {
            transform.SetParent(main.rocketsPool);
            flying = false;

            Jail jail = other.GetComponent <Jail>();
            jail.curHP        -= damage;
            jail.textMesh.text = jail.curHP.ToString();

            if (jail.curHP <= 0)
            {
                Destroy(jail.gameObject);
            }
        }
        else if (other.tag == "Player")
        {
            if (other.tag != MyShooterTag)
            {
                Player plr = other.GetComponent <Player>();
                if (plr.inParty)
                {
                    plr.curHealthPoint -= damage;

                    if (plr.curHealthPoint <= 0)
                    {
                        main.playersInParty.Remove(plr);
                        Destroy(plr.healthPanel.gameObject);
                        Destroy(plr.gameObject);
                    }
                }
            }
        }
        else if (other.tag == "Enemy")
        {
            if (other.tag != MyShooterTag)
            {
                Enemy enm = other.GetComponent <Enemy>();
                enm.curHealthPoint -= damage;

                if (enm.curHealthPoint <= 0)
                {
                    Destroy(enm.gameObject);
                }
            }
        }


        //// если прожектайл столкнулся с препятствием - возвращаем в пул
        //if (other.gameObject.layer == 9)
        //{
        //    //transform.SetParent(main.rocketsPool);
        //    flying = false;
        //}
        //// если прожектайл столкнулся с НПС - наносим урон - возвращаем в пул
        //else if (other.gameObject.layer == 10)
        //{
        //    if (other.tag != MyShooterTag) // исключаем самопоражение и фрэндли файр
        //    {
        //        if (other.tag == "Enemy")
        //        {

        //        }

        //        else if (other.tag == "Player")
        //        {

        //        }

        //        flying = false;
        //        //transform.SetParent(main.rocketsPool);
        //    }
        //}
    }