void Awake() { stats = GameObject.Find("RoundManager").GetComponent<RoundStats>(); startingHealth = stats.BASE_HEALTH; currentHealth = startingHealth; healthSlider.maxValue = startingHealth; healthSlider.value = currentHealth; }
public override int GetHashCode() { unchecked { var hashCode = Rank; hashCode = (hashCode * 397) ^ (RoundStats?.GetHashCode() ?? 0); hashCode = (hashCode * 397) ^ (int)Score; hashCode = (hashCode * 397) ^ TeamId; return(hashCode); } }
void Awake() { // Setting up the references. anim = this.GetComponentInChildren<Animator>(); enemyAudio = GetComponent<AudioSource>(); hitParticles = GetComponentInChildren<ParticleSystem>(); capsuleCollider = GetComponent<CapsuleCollider>(); // Setting the current health when the enemy first spawns. stats = GameObject.Find("RoundManager").GetComponent<RoundStats>(); startingHealth = stats.ENEMY_HEALTH; currentHealth = startingHealth; }
private void PrepareForNextRound() { roundStats = new RoundStats(players, roundStats); CreateLandAndObstaclesFromFile("Data/Maps/-57604.arena"); foreach (var player in players) { player.PrepareForRound(); } SetPlayerInitialPositions(); remainingLoadingTime = MAX_LOADING_DURATION; }
public Arena(List <User> users) : this() { foreach (var user in users) { user.state = User.UserState.Game; players.Add(new Player(user, this)); } foreach (var player in players) { Game.clientPlayerMap.Add(player.user.client, player); } SetPlayerInitialPositions(); roundStats = new RoundStats(players); }
public bool Equals(TeamStat other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return(Rank == other.Rank && RoundStats.OrderBy(rs => rs.RoundNumber).SequenceEqual(other.RoundStats.OrderBy(rs => rs.RoundNumber)) && Score == other.Score && TeamId == other.TeamId); }
private void Running(object message) { if (_currentMessages < _maxExpectedMessages) { _currentMessages++; _echo.Tell(message); } else // reached the end of the benchmark { var elapsed = DateTimeOffset.UtcNow - _start; var roundStats = new RoundStats() { ReceivedMessages = _currentMessages, Pingee = _pingee, Pinger = _selfAddress, Elapsed = elapsed }; Context.Parent.Tell(roundStats); Context.Stop(Self); // shut ourselves down } }
public static string ReplaceVariables(string input) { RoundStats stats = PluginManager.Manager.Server.Round.Stats; int minutes = (int)(PluginManager.Manager.Server.Round.Duration / 60), duration = PluginManager.Manager.Server.Round.Duration; input = input.Replace("$scp_alive", stats.SCPAlive.ToString()); input = input.Replace("$scp_start", stats.SCPStart.ToString()); input = input.Replace("$scp_dead", stats.SCPDead.ToString()); input = input.Replace("$scp_zombies", stats.Zombies.ToString()); input = input.Replace("$classd_alive", stats.ClassDAlive.ToString()); input = input.Replace("$classd_escape", stats.ClassDEscaped.ToString()); input = input.Replace("$classd_start", stats.ClassDStart.ToString()); input = input.Replace("$scientists_alive", stats.ScientistsAlive.ToString()); input = input.Replace("$scientists_escape", stats.ScientistsEscaped.ToString()); input = input.Replace("$scientists_start", stats.ScientistsStart.ToString()); input = input.Replace("$scp_kills", stats.SCPKills.ToString()); input = input.Replace("$grenade_kills", stats.GrenadeKills.ToString()); input = input.Replace("$mtf_alive", stats.NTFAlive.ToString()); input = input.Replace("$ci_alive", stats.CiAlive.ToString()); input = input.Replace("$tutorial_alive", CountRoles(Role.TUTORIAL).ToString()); input = input.Replace("$round_duration", (duration < 60) ? duration + ((duration == 1) ? " second" : " seconds") : minutes + ((minutes == 1) ? " minute" : " minutes") + " and " + (duration - (minutes * 60)) + ((duration - (minutes * 60) == 1) ? " second" : " seconds")); string[] words = input.Split(' '); for (int i = 0; i < words.Length; i++) { if (Int32.TryParse(words[i], out int a)) { if (a > 20) { words[i] = ann.ConvertNumber(a).ToString(); } } } return(StringArrayToString(words, 0)); }
public void Initialize(int number, int linesObjetive, Transform placeStats) { player = GetComponent <Player>(); state = RoundState.Starting; linesCompleted = 0; this.number = number; this.linesObjective = linesObjetive; tetroMinosSpawned = new Dictionary <TetroMinoColor, int>(); tetroMinosSpawned.Add(TetroMinoColor.Blue, 0); tetroMinosSpawned.Add(TetroMinoColor.Cyan, 0); tetroMinosSpawned.Add(TetroMinoColor.Green, 0); tetroMinosSpawned.Add(TetroMinoColor.Magenta, 0); tetroMinosSpawned.Add(TetroMinoColor.Orange, 0); tetroMinosSpawned.Add(TetroMinoColor.Red, 0); tetroMinosSpawned.Add(TetroMinoColor.Yellow, 0); state = RoundState.Playing; if (GameManager.instance.singlePlayer) { roundStats = GetComponent <RoundStats>(); roundStats.enabled = true; roundStats.Initialize(placeStats); } }
// Use this for initialization void Start() { stats = GameObject.Find("RoundManager").GetComponent<RoundStats>(); player = GameObject.FindWithTag("Player"); anim = this.transform.GetComponent<Animator>(); if (this.transform.name == "knife") { damage = PlayerPrefs.GetInt("KnifeDmg"); } else if (this.transform.name == "crowbar") { damage = PlayerPrefs.GetInt("CrowbarDmg"); } anim.enabled = true; }
// Use this for initialization void Start() { stats = GameObject.Find("RoundManager").GetComponent<RoundStats>(); weaponCamera = GameObject.FindWithTag("WeaponCamera"); mainCamera = GameObject.FindWithTag("MainCamera"); player = GameObject.FindWithTag("Player"); bulletsLeft = bulletsPerMag; currentMode = firstMode; fireRate = fireRateFirstMode; aiming = false; if (ammoMode == Ammo.Bullets) { magazines = magazines * bulletsPerMag; } if (currentMode == fireMode.semi) { damage = PlayerPrefs.GetInt("GunDmg"); bulletsLeft = PlayerPrefs.GetInt("GunAmmo"); } if (currentMode == fireMode.burst) { damage = PlayerPrefs.GetInt("ShotgunDmg"); bulletsLeft = PlayerPrefs.GetInt("ShotgunAmmo"); } statUpdater.setAmmo(bulletsLeft); //weaponAnim.GetComponent<Animation>().wrapMode = WrapMode.Loop; //weaponAnim.GetComponent<Animator>().SetBool("IsWalking", false); //muzzleFlash.enabled = false; //gunLine.enabled = false; }
// Use this for initialization void Start() { stats = GameObject.Find("RoundManager").GetComponent<RoundStats>(); statUpdater = GameObject.Find("Stats").GetComponent<StatUpdater>(); //turret = this.transform.FindChild("turret"); //anim = this.GetComponentInChildren<Animator>(); //sightLight = transform.GetComponent<LineRenderer>(); // pipe = turret.FindChild("Tube02"); laserSight.SetPosition(0, pipe.position); laserSight.SetPosition(1, pipe.transform.position + pipe.transform.TransformDirection(0, 0, 1) * 0.5f); laserSight.enabled = false; //light = turret.FindChild("Box06").GetComponentInChildren<Light>(); muzzleLight.enabled = false; muzzleFlash.enabled = false; FIRE_RATE = PlayerPrefs.GetFloat("TurretRate"); BASE_DAMAGE = PlayerPrefs.GetInt("TurretDmg"); InvokeRepeating("Fire", 5, FIRE_RATE); }
public void StartRound() { currentRoundStats = new RoundStats(this); Spawn(); }