public int ArtistGeneratePoints(int chance, Artist artist, ArtistStats statType, MusicalStyles musicalStyle, VisualStyles visualStyle) { int generated = GetPoints(chance, artist, statType, musicalStyle, visualStyle); if (generated <= 0) { if (statType == ArtistStats.VISUALS) { if (artist.PityVisuals < artist.GetVisuals() * 2) { artist.PityVisuals = artist.GetVisuals() * 2; } else { artist.PityVisuals += artist.GetVisuals(); } // Debug.WriteLine("Visuals Points: " + generated + " - Pity Visuals: " + artist.PityVisuals); } else if (statType == ArtistStats.VOCALS) { if (artist.PityVocals < artist.GetVocals() * 2) { artist.PityVocals = artist.GetVocals() * 2; } else { artist.PityVocals += artist.GetVocals(); } // Debug.WriteLine("Vocals Points: " + generated + " - Pity Vocals: " + artist.PityVocals); } else if (statType == ArtistStats.DANCE) { if (artist.PityDance < artist.GetDance() * 2) { artist.PityDance = artist.GetDance() * 2; } else { artist.PityDance += artist.GetDance(); } // Debug.WriteLine("Dance Points: " + generated + " - Pity Dance: " + artist.PityDance); } else if (statType == ArtistStats.PERSONALITY) { if (artist.PityPersonality < artist.GetPersonality() * 2) { artist.PityPersonality = artist.GetPersonality() * 2; } else { artist.PityPersonality += artist.GetPersonality(); } // Debug.WriteLine("Personality Points: " + generated + " - Pity Personality: " + artist.PityPersonality); } } else { if (statType == ArtistStats.VISUALS) { artist.PityVisuals = 0; // Debug.WriteLine("Visuals Points: " + generated + " - Pity Visuals: " + artist.PityVisuals); } else if (statType == ArtistStats.VOCALS) { artist.PityVocals = 0; // Debug.WriteLine("Vocals Points: " + generated + " - Pity Vocals: " + artist.PityVocals); } else if (statType == ArtistStats.DANCE) { artist.PityDance = 0; // Debug.WriteLine("Dance Points: " + generated + " - Pity Dance: " + artist.PityDance); } else if (statType == ArtistStats.PERSONALITY) { artist.PityPersonality = 0; // Debug.WriteLine("Personality Points: " + generated + " - Pity Personality: " + artist.PityPersonality); } } return(generated); }
/* * Recursive function that RNGs an artist using their stat to generate points * Keeps RNG range through a cumulative variable * If successful roll on [0, culVariable), degrade culVariable by pointStep * difficulty chance */ public int GetPoints(int chance, Artist artist, ArtistStats statType, MusicalStyles musicalStyle, VisualStyles visualStyle) { int result = 0; if (statType == ArtistStats.VISUALS) { if (artist.PityVisuals == 0) { result = random.Next(0, (int)artist.GetVisuals()); } else { result = random.Next(0, (int)artist.PityVisuals); } if (visualStyle == VisualStyles.Cutesy) { if (artist.VisualArchetype == VisualArchetypes.Adorable || artist.VisualArchetype == VisualArchetypes.Enchanting) { result += 5; } } else if (visualStyle == VisualStyles.Girl_Crush) { if (artist.VisualArchetype == VisualArchetypes.Bewitching || artist.VisualArchetype == VisualArchetypes.Elegant) { result += 5; } } else if (visualStyle == VisualStyles.Retro) { if (artist.VisualArchetype == VisualArchetypes.Adorable || artist.VisualArchetype == VisualArchetypes.Gorgeous) { result += 5; } } else if (visualStyle == VisualStyles.Party) { if (artist.VisualArchetype == VisualArchetypes.Bewitching || artist.VisualArchetype == VisualArchetypes.Fatale) { result += 5; } } else if (visualStyle == VisualStyles.Provocative) { if (artist.VisualArchetype == VisualArchetypes.Elegant || artist.VisualArchetype == VisualArchetypes.Fatale) { result += 5; } } else { if (artist.VisualArchetype == VisualArchetypes.Enchanting || artist.VisualArchetype == VisualArchetypes.Gorgeous) { result += 5; } } if (result >= chance) { artist.PityVisuals = 0; return(1 + GetPoints(Convert.ToInt32(chance * pointStep), artist, statType, musicalStyle, visualStyle)); } else { return(0); } } else if (statType == ArtistStats.VOCALS) { if (artist.PityVocals == 0) { result = random.Next(0, (int)artist.GetVocals()); } else { result = random.Next(0, (int)artist.PityVocals); } // Bonus based on Talent/100 and type of musical style (XFactor/100) * (Songwriting || Arrangement) int talent = random.Next(0, 101); int type = random.Next(0, 2); if (musicalStyle == MusicalStyles.Ballad || musicalStyle == MusicalStyles.Bubblegum || musicalStyle == MusicalStyles.Disco_Pop || musicalStyle == MusicalStyles.RnB || musicalStyle == MusicalStyles.Soul) { if (talent > artist.XFactor) { result += Convert.ToInt32((artist.XFactor / 100.0f) * artist.Songwriting); } } else if (musicalStyle == MusicalStyles.Bebop || musicalStyle == MusicalStyles.Blues || musicalStyle == MusicalStyles.Dubstep || musicalStyle == MusicalStyles.Electronica || musicalStyle == MusicalStyles.Funk || musicalStyle == MusicalStyles.Jazz || musicalStyle == MusicalStyles.Swing || musicalStyle == MusicalStyles.Trap) { if (talent > artist.XFactor) { result += Convert.ToInt32((artist.XFactor / 100.0f) * artist.Arrangement); } } else { if (type == 0) { if (talent > artist.XFactor) { result += Convert.ToInt32((artist.XFactor / 100.0f) * artist.Songwriting); } } else { if (talent > artist.XFactor) { result += Convert.ToInt32((artist.XFactor / 100.0f) * artist.Arrangement); } } } if (result >= chance) { artist.PityVocals = 0; return(1 + GetPoints(Convert.ToInt32(chance * pointStep), artist, statType, musicalStyle, visualStyle)); } else { return(0); } } else if (statType == ArtistStats.DANCE) { if (artist.PityDance == 0) { result = random.Next(0, (int)artist.GetDance()); } else { result = random.Next(0, (int)artist.PityDance); } int talent = random.Next(0, 101); if (talent > artist.XFactor) { result += Convert.ToInt32((artist.XFactor / 100.0f) * artist.Choreography); } if (result >= chance) { artist.PityDance = 0; return(1 + GetPoints(Convert.ToInt32(chance * pointStep), artist, statType, musicalStyle, visualStyle)); } else { return(0); } } else if (statType == ArtistStats.PERSONALITY) { if (artist.PityPersonality == 0) { result = random.Next(0, (int)artist.GetPersonality()); } else { result = random.Next(0, (int)artist.PityPersonality); } if (result >= chance) { artist.PityPersonality = 0; return(1 + GetPoints(Convert.ToInt32(chance * pointStep), artist, statType, musicalStyle, visualStyle)); } else { return(0); } } else { return(0); } }