public void LoadKitchen(StepData data) { ++current_day; current_mode = Gamemodes.Kitchen; audioSource.PlayOneShot(fireSound); StartCoroutine(LoadSceneTransition(2)); }
public bool IsFlat; //* public override void Read(byte[] array) { McInt.TryParse(ref array, out EntityId); McBoolean.TryParse(ref array, out IsHardcore); if (McUnsignedByte.TryParse(ref array, out var gamemode)) { Gamemode = (Gamemodes)gamemode; } if (McByte.TryParse(ref array, out var previousGamemode)) { PreviousGamemode = (Gamemodes)previousGamemode; } McVarint.TryParse(ref array, out WorldCount); McStringArray.TryParse(WorldCount, ref array, out WorldNames); McNbtCompoundTag.TryParse(ref array, out DimensionCodec); McNbtCompoundTag.TryParse(ref array, out Dimension); McString.TryParse(ref array, out WorldName); McLong.TryParse(ref array, out HashedSeed); McVarint.TryParse(ref array, out MaxPlayers); McVarint.TryParse(ref array, out ViewDistance); McBoolean.TryParse(ref array, out ReducedDebugInfo); McBoolean.TryParse(ref array, out EnableRespawnScreen); McBoolean.TryParse(ref array, out IsDebug); McBoolean.TryParse(ref array, out IsFlat); }
private void ApplyDefaultConditions(int size, int gravity, Gamemodes gameMode) { Gravity = gravity; Velocity = size / 8; MaxFallingVel = size / 5; MaxFlyingVel = Velocity; GameMode = gameMode; }
public DSdyn_filteroptions() { foreach (var ent in DSdata.s_gamemodes) { Gamemodes.Add(ent, false); } Gamemodes["GameModeCommanders"] = true; Gamemodes["GameModeCommandersHeroic"] = true; }
public void LoadNarration(StepData data) { if (current_step == 0) { audioSource.PlayOneShot(dingdongSound); } else if (current_step == 1 || steps[current_step].type == StepData.stepType.Cooking) { audioSource.PlayOneShot(endofkitchenSound); } current_mode = Gamemodes.Narration; StopAllCoroutines(); StartCoroutine(LoadSceneTransition(1)); }
public GameSettings(ICommunicationHelper communication, Gamemodes gamemodes, IServiceProvider provider) { InitializeComponent(); _communication = communication; _provider = provider; LockSliders(); LevelsList.ItemsSource = gamemodes.List; LevelsList.SelectedItem = gamemodes.List.FirstOrDefault(); BombsSlider.Minimum = GamemodeDto.MinBombs; HeightSlider.Minimum = GamemodeDto.MinHeight; HeightSlider.Maximum = GamemodeDto.MaxHeight; WidthSlider.Minimum = GamemodeDto.MinWidth; WidthSlider.Maximum = GamemodeDto.MaxWidth; }
// Start is called before the first frame update void Start() { Enemy = FindObjectOfType <Enemy>(); Enemy.EnemySelected += EndGame; User myUser = JSONManager.DeserealizeData <User>(Path.Combine(Application.persistentDataPath, "UserInfo.json")); PlayerProfile.GetComponentInChildren <Text>().text = myUser.Name; PlayerProfile.GetComponent <Image>().sprite = Resources.Load <Sprite>("Sprites/zodiac/" + myUser.Star); gameMode = (Gamemodes)PlayerPrefs.GetInt("Multi"); if (gameMode == Gamemodes.Multi) { MultiManager.Inctance.EnemySelected += Multimanager_EnemySelected; MultiManager.Inctance.EnemyInfoReceived += Multimanager_EnemyInfoReceived; } }
public string GenHash() { string opthash = ""; opthash += Mode; opthash += Build; opthash += Duration; opthash += Leaver + Army + Kills + Income; opthash += Startdate.ToString("yyyyMMdd"); opthash += Enddate.ToString("yyyyMMdd"); opthash += Interest; opthash += Vs; opthash += Player; opthash += String.Join("", Dataset.OrderBy(o => o)); opthash += String.Join("", Gamemodes.Where(x => x.Value == true).OrderBy(o => o.Key).Select(s => s.Key)); opthash += String.Join("", Players.Where(x => x.Value == true).OrderBy(o => o.Key).Select(s => s.Key)); opthash += Breakpoint; opthash += MengskPreviewFilter; Hash = opthash; return(opthash); }
public DSoptions() { foreach (var ent in DSdata.s_gamemodes) { Gamemodes.Add(ent, false); } Gamemodes["GameModeCommanders"] = true; Gamemodes["GameModeCommandersHeroic"] = true; foreach (var ent in DSdata.Config.Players) { this.Players[ent] = true; } foreach (var ent in DSdata.s_races) { this.CmdrsChecked[ent] = false; } ID = Interlocked.Increment(ref DSdata.OptID); Hash = GenHash(); }
public Player(Point mapStartPos, int size, Gamemodes gameMode = Gamemodes.Cube, int gravity = 1) { X = mapStartPos.X * size; Y = mapStartPos.Y * size; ApplyDefaultConditions(size, gravity, gameMode); }
public void EndGame() { current_mode = Gamemodes.Endgame; StartCoroutine(LoadSceneTransition(3)); }
public void AttachGameMode(Gamemodes.ClientGameMode gameMode) { currentGameMode = gameMode; gameMode.OnAttachedToClient(this); }
public List <string> GetGamemodes() { return(Gamemodes.Where(x => x.Value == true).Select(s => s.Key).ToList()); }
public override string ToString() { return($"{Plugin.Info.Metadata.Name} [{string.Join(", ", Gamemodes.Select(x => x.DisplayName))}]"); }
public void AttachClientGameMode(Gamemodes.ClientGameMode gameMode) { client.AttachGameMode(gameMode); }
protected override void Update() { base.Update(); if (ScriptEnabled) { // Root Menu With Buttons if (!IsReplay) { Debug.Log("hi>"); if (Confirm()) { switch (pos) { case 0: Rematch(); break; case 1: ReplaySelected(); break; case 2: ReturnToMenu(); break; default: break; } } if (ValueChanged()) { UpdateDisplay(); } MoveLR(); } else if ((IsReplay) && (!ReplayOptionSelected)) { MoveUD(); if (ValueChanged()) { UpdateReplayDisplay(); } Debug.Log("hi>>"); if (Confirm() && !IsCoR) { switch (pos) { case 0: SelectedGamemode = Gamemodes.Lives; IncrementAmount = 1; Value = 5; minValue = Value; UpdateTextValue(); break; case 1: SelectedGamemode = Gamemodes.Timer; IncrementAmount = 15; Value = 60; minValue = Value; UpdateTextValue(); break; case 2: SelectedGamemode = Gamemodes.SetScore; IncrementAmount = 1000; Value = 1000; minValue = Value; UpdateTextValue(); break; default: break; } ReplayOptionSelected = true; } else if (Return() && !IsCoR) { pos = 1; IsReplay = false; StartCoroutine(InputDelay()); } } else if ((IsReplay) && (ReplayOptionSelected)) { Debug.Log("hi>>>"); if (Confirm() && !IsCoR) { SaveManager.SaveUltimatePinballGamemode((int)SelectedGamemode, IncrementAmount, Value); StartCoroutine(LoadReplay()); } else if (Return() && !IsCoR) { ReplayOptionSelected = false; StartCoroutine(InputDelay()); } } else { Debug.Log("hi"); } } if (IsReplay && ReplayCanvas.alpha != 1) { ReplayCanvas.alpha += Time.deltaTime * 2; } else if (!IsReplay && ReplayCanvas.alpha != 0) { ReplayCanvas.alpha -= Time.deltaTime * 2; } // Updates the amount needed text and revials it if (IsReplay && ReplayOptionSelected && SelectedGamemode != Gamemodes.None) { if (ReplayValueCanvas.alpha != 1) { ReplayValueCanvas.alpha += Time.deltaTime * 2; } switch (ControllerType) { case SupportedControllers.ArcadeBoard: if ((ArcadeControls.JoystickLeft(Joysticks.White) && (!IsCoR))) { if (Value != minValue) { Value -= IncrementAmount; } StartCoroutine(InputDelay()); UpdateTextValue(); } if ((ArcadeControls.JoystickRight(Joysticks.White) && (!IsCoR))) { Value += IncrementAmount; StartCoroutine(InputDelay()); UpdateTextValue(); } break; case SupportedControllers.GamePadBoth: if ((ControllerControls.ControllerLeft(Players.P1) && (!IsCoR))) { if (Value != minValue) { Value -= IncrementAmount; } StartCoroutine(InputDelay()); UpdateTextValue(); } if ((ControllerControls.ControllerRight(Players.P1) && (!IsCoR))) { Value += IncrementAmount; StartCoroutine(InputDelay()); UpdateTextValue(); } break; case SupportedControllers.KeyboardBoth: if ((KeyboardControls.KeyboardLeft(Players.P1) && (!IsCoR))) { if (Value != minValue) { Value -= IncrementAmount; } StartCoroutine(InputDelay()); UpdateTextValue(); } if ((KeyboardControls.KeyboardRight(Players.P1) && (!IsCoR))) { Value += IncrementAmount; StartCoroutine(InputDelay()); UpdateTextValue(); } break; case SupportedControllers.KeyboardP1ControllerP2: if ((KeyboardControls.KeyboardLeft(Players.P1) && (!IsCoR))) { if (Value != minValue) { Value -= IncrementAmount; } StartCoroutine(InputDelay()); UpdateTextValue(); } if ((KeyboardControls.KeyboardRight(Players.P1) && (!IsCoR))) { Value += IncrementAmount; StartCoroutine(InputDelay()); UpdateTextValue(); } break; case SupportedControllers.KeyboardP2ControllerP1: if ((ControllerControls.ControllerLeft(Players.P1) && (!IsCoR))) { if (Value != minValue) { Value -= IncrementAmount; } StartCoroutine(InputDelay()); UpdateTextValue(); } if ((ControllerControls.ControllerRight(Players.P1) && (!IsCoR))) { Value += IncrementAmount; StartCoroutine(InputDelay()); UpdateTextValue(); } break; default: break; } } else if (IsReplay && !ReplayOptionSelected && ReplayValueCanvas.alpha != 0) { ReplayValueCanvas.alpha -= Time.deltaTime * 2; } }
public void SetMode(Gamemodes newMode) { mode = newMode; }
public void OnStartMission(Gamemodes gamemode) { Gamemode = gamemode; LoadIPL(); foreach (var veh in _decorativeVehicles.Where(x => x.EntryPoint == -1)) { var tmpMod = new Model(veh.Model); int counter = 0; do { tmpMod.Request(); counter++; Script.Yield(); } while (!tmpMod.IsLoaded && counter < 10000); if (counter >= 10000) { continue; } Vehicle tmpVeh = new Vehicle(Function.Call <int>(Hash.CREATE_VEHICLE, tmpMod.Hash, veh.Position.X, veh.Position.Y, veh.Position.Z, veh.Heading, false, false)); tmpVeh.SirenActive = veh.SirenActive; foreach (VehicleDoor door in veh.OpenDoors) { tmpVeh.OpenDoor(door, false, false); } CleanupBag.Add(tmpVeh); } var tmpposs = new List <Tuple <Vector3, float> >(_positions); var tmpMax = _maxEnemies; if (_maxEnemies == -1) { tmpMax = Enemy.Dice.Next(_positions.Count / 2, _positions.Count); } MaxEnemies = tmpMax; for (int i = 0; i < tmpMax; i++) { Enemy tmp; int ourPick = Enemy.Dice.Next(tmpposs.Count); Tuple <Vector3, float> ourTuple = tmpposs[ourPick]; tmp = new Enemy(ourTuple.Item1, ourTuple.Item2); tmpposs.RemoveAt(ourPick); tmp.Character.Task.GuardCurrentPosition(); BadGuys.Add(tmp); CleanupBag.Add(tmp.Character); } if (Gamemode == Gamemodes.BombDefusal) { BombDefused = false; _defusePercentage = 0; _defuseStart = null; IsDefusingBomb = false; var ourPick = _bombLocations[Enemy.Dice.Next(_bombLocations.Count)]; CurrentBomb = new Tuple <Vector3, float>(ourPick.Item1, ourPick.Item2); int counter = 0; var barrelM = new Model(1298403575); do { barrelM.Request(); counter++; Script.Yield(); } while (!barrelM.IsLoaded && counter < 2000); var barrel = World.CreateProp(barrelM, CurrentBomb.Item1 - new Vector3(0f, 0f, 1f), new Vector3(0f, 0f, CurrentBomb.Item2), false, false); barrel.FreezePosition = true; counter = 0; var bombM = new Model(929047740); do { bombM.Request(); counter++; Script.Yield(); } while (!bombM.IsLoaded && counter < 2000); var bomb = World.CreateProp(bombM, CurrentBomb.Item1 - new Vector3(0f, 0f, 0.2f), new Vector3(-90f, 0f, CurrentBomb.Item2), false, false); bomb.FreezePosition = true; CleanupBag.Add(barrel); CleanupBag.Add(bomb); } }
public Player(int x, int y, int size, Gamemodes gameMode = Gamemodes.Cube, int gravity = 1) { X = x; Y = y; ApplyDefaultConditions(size, gravity, gameMode); }
public void OnStartMission(Gamemodes gamemode) { Gamemode = gamemode; LoadIPL(); foreach (var veh in _decorativeVehicles.Where(x => x.EntryPoint == -1)) { var tmpMod = new Model(veh.Model); int counter = 0; do { tmpMod.Request(); counter++; Script.Yield(); } while (!tmpMod.IsLoaded && counter < 10000); if(counter >= 10000) continue; Vehicle tmpVeh = new Vehicle(Function.Call<int>(Hash.CREATE_VEHICLE, tmpMod.Hash, veh.Position.X, veh.Position.Y,veh.Position.Z, veh.Heading, false, false)); tmpVeh.SirenActive = veh.SirenActive; foreach (VehicleDoor door in veh.OpenDoors) { tmpVeh.OpenDoor(door, false, false); } CleanupBag.Add(tmpVeh); } var tmpposs = new List<Tuple<Vector3, float>>(_positions); var tmpMax = _maxEnemies; if (_maxEnemies == -1) tmpMax = Enemy.Dice.Next(_positions.Count/2, _positions.Count); MaxEnemies = tmpMax; for(int i = 0; i < tmpMax; i++) { Enemy tmp; int ourPick = Enemy.Dice.Next(tmpposs.Count); Tuple<Vector3, float> ourTuple = tmpposs[ourPick]; tmp = new Enemy(ourTuple.Item1, ourTuple.Item2); tmpposs.RemoveAt(ourPick); tmp.Character.Task.GuardCurrentPosition(); BadGuys.Add(tmp); CleanupBag.Add(tmp.Character); } if (Gamemode == Gamemodes.BombDefusal) { BombDefused = false; _defusePercentage = 0; _defuseStart = null; IsDefusingBomb = false; var ourPick = _bombLocations[Enemy.Dice.Next(_bombLocations.Count)]; CurrentBomb = new Tuple<Vector3, float>(ourPick.Item1, ourPick.Item2); int counter = 0; var barrelM = new Model(1298403575); do { barrelM.Request(); counter++; Script.Yield(); } while (!barrelM.IsLoaded && counter < 2000); var barrel = World.CreateProp(barrelM, CurrentBomb.Item1 - new Vector3(0f, 0f, 1f), new Vector3(0f, 0f, CurrentBomb.Item2), false, false); barrel.FreezePosition = true; counter = 0; var bombM = new Model(929047740); do { bombM.Request(); counter++; Script.Yield(); } while (!bombM.IsLoaded && counter < 2000); var bomb = World.CreateProp(bombM, CurrentBomb.Item1 - new Vector3(0f, 0f, 0.2f), new Vector3(-90f, 0f, CurrentBomb.Item2), false, false); bomb.FreezePosition = true; CleanupBag.Add(barrel); CleanupBag.Add(bomb); } }