public static bool CheckIfFreshCharacter(GunPlayer ply) { foreach(Item item in ply.TSPlayer.TPlayer.armor) { if (item.type != 0) return false; } if (ply.TSPlayer.TPlayer.statLifeMax != 100) return false; return true; }
public static void GiveNewItems(GunPlayer ply, int level, LevelList list) { int x = ply.TSPlayer.TileX; int y = ply.TSPlayer.TileY; ply.TSPlayer.DamagePlayer(500); ply.TSPlayer.Teleport(x, y); string[] items = list.Levels[level]; foreach (string item in items) { if (item != "null") { Item give = TShock.Utils.GetItemByName(item)[0]; ply.GiveItem(give.type, give.name, give.width, give.height, give.maxStack); } } if (list.Knife != "null") { Item knife = TShock.Utils.GetItemByName(list.Knife)[0]; ply.GiveItem(knife.type, knife.name, knife.width, knife.height, knife.maxStack); } ply.TSPlayer.Teleport(x, y); }
public static void SpawnAndGiveItems(GunPlayer ply) { ply.TSPlayer.Spawn(); ply.GiveCurrentLevel(); }
public void Winner(GunPlayer ply) { lock (Players) { foreach (GunPlayer gm in Players) { gm.TSPlayer.SendMessage(String.Format("The game is over and {0} has won!",ply.TSPlayer.Name)); } } EndGame(); }