public override void OnPlayerGhostCollide(PlayerGhost ghost) { if (!base.Flashing && this.type != Types.Large && this.type != Types.Bottomless) { if (((MyMatchVariants)Level.Session.MatchSettings.Variants).GhostItems) { MyPlayerGhost g = (MyPlayerGhost)ghost; if (this.pickups[0].ToString() == "SpeedBoots" && !g.HasSpeedBoots || this.pickups[0].ToString() == "Shield" && !g.HasShield || this.pickups[0].ToString().Contains("Orb")) { this.OpenChest(ghost.PlayerIndex); } else { this.OpenChestForceBomb(ghost.PlayerIndex); } } else { this.OpenChestForceBomb(ghost.PlayerIndex); } TFGame.PlayerInputs[ghost.PlayerIndex].Rumble(0.5f, 12); } }
public override void OnPlayerGhostCollide(PlayerGhost ghost) { if (((MyMatchVariants)Level.Session.MatchSettings.Variants).GhostItems) { MyPlayerGhost g = (MyPlayerGhost)ghost; if (!g.HasShield) { base.Level.Layers[g.LayerIndex].Add(new LightFade().Init(this, null)); base.DoCollectStats(g.PlayerIndex); g.HasShield = true; base.RemoveSelf(); } } }
public override void OnPlayerGhostCollide(PlayerGhost ghost) { if (((MyMatchVariants)Level.Session.MatchSettings.Variants).GhostItems) { MyPlayerGhost g = (MyPlayerGhost)ghost; if (!g.Invisible) { base.Level.Layers[g.LayerIndex].Add(new LightFade().Init(this, null)); g.Invisible = true; Sounds.pu_invisible.Play(base.X, 1f); base.RemoveSelf(); } } }
public override bool FFACheckForAllButOneDead() { if (((MyMatchVariants)(this.Session.MatchSettings.Variants)).GottaBustGhosts) { if (this.Session.CurrentLevel.LivingPlayers == 0) { return(true); } // Round not over if ghost spawning List <Entity> players = this.Session.CurrentLevel[GameTags.Player]; for (int i = 0; i < players.Count; i++) { MyPlayer player = (MyPlayer)players[i]; if (player.spawningGhost) { return(false); } } List <Entity> playerCorpses = this.Session.CurrentLevel[GameTags.Corpse]; for (int i = 0; i < playerCorpses.Count; i++) { MyPlayerCorpse playerCorpse = (MyPlayerCorpse)playerCorpses[i]; if (playerCorpse.spawningGhost) { return(false); } } // Round not over if ghosts alive List <Entity> playerGhosts = this.Session.CurrentLevel[GameTags.PlayerGhost]; int livingGhostCount = 0; for (int i = 0; i < playerGhosts.Count; i++) { MyPlayerGhost ghost = (MyPlayerGhost)playerGhosts[i]; if (ghost.State != 3) { livingGhostCount += 1; } } return(livingGhostCount == 0 && this.Session.CurrentLevel.LivingPlayers <= 1); } else { return(this.Session.CurrentLevel.LivingPlayers <= 1); } }
public void OnGhostCollect(MyPlayerGhost ghost, bool force = false) { if (force || this.IsCollectible) { if ((ghost != null) && (ghost.CollectArrow(this.ArrowType))) { if (this.BuriedIn != null) { this.BuriedIn.OnCollect(); } if (base.Scene != null) { base.RemoveSelf(); } this.Collidable = false; } } }
public override void OnPlayerGhostCollide(PlayerGhost ghost) { if (((MyMatchVariants)Level.Session.MatchSettings.Variants).GhostItems) { MyPlayerGhost g = (MyPlayerGhost)ghost; if (!g.HasSpeedBoots) { Sounds.pu_speedBoots.Play(base.X, 1f); g.HasSpeedBoots = true; base.Level.Layers[g.LayerIndex].Add(new LightFade().Init(this, null)); for (int i = 0; i < 30; i++) { base.Level.Particles.Emit(Particles.SpeedBootsPickup, 1, base.Position, Vector2.One * 3f, 6.28318548f * (float)i / 30f); } base.Level.Particles.Emit(Particles.SpeedBootsPickup2, 18, base.Position, Vector2.One * 4f); base.DoCollectStats(g.PlayerIndex); base.RemoveSelf(); } } }