Generation

generate functionSat, 28 Jan 2023

generate a function for losing player items at death

public void player_loss() { random_loss = rand.Next(1, 5); if (random_loss == 1) { inv.Remove_item("pistol"); } else if (random_loss == 2) { inv.Remove_item("rifle"); } else if (random_loss == 3) { inv.Remove_item("machete"); } else if (random_loss == 4) { inv.Remove_item("ammo"); } else if (random_loss == 5) { inv.Remove_item("medkit"); } }

Questions about programming?Chat with your personal AI assistant