public void SpecialMoveChance(Character attacker, Character defender, Fight1v1 fight) { bool activateSpecialMove = false; float specialChanceDivisonFactor = 1000f; float fighterSpecialChanceValue = attacker.Magic + attacker.Strategy; float fighterSpecialChance = fighterSpecialChanceValue / specialChanceDivisonFactor; activateSpecialMove = StandardFunctions.CheckPercentageChance(fighterSpecialChance); if (activateSpecialMove) { //TODO_P: Add a system for handling selection of special moves SpecialMoves.PowerStrike(attacker, defender, fight); } }
public void SecondWindChance(Character fighter, Audience audience) { float comebackitudeChance = fighter.Comebackitude / 10f; bool activateSecondWind = StandardFunctions.CheckPercentageChance(comebackitudeChance); if (activateSecondWind) { fighter.ActivateSecondWind(); if (PlayerWatchingFight) { string secondWindActivation = fighter.FirstName + " has activated " + fighter.Gender.HerHis + " Second Wind!"; fightPanel.UpdateTextLog(secondWindActivation); } } }
void SetAge() { int minAge = 0; int maxAge = 0; int peakAge = 0; minAge = Race.MinAge; maxAge = Race.MaxAge; peakAge = Race.PeakAge; int randomAge = GameObject.Find("GameController").GetComponent <GameController>().GameRandom.Next(minAge, maxAge); //Roll for inital age if (randomAge < peakAge) //Check difference from peak age, if lower have a chance of adjusting it up by half of the difference between set age and peak { int randomPeakDiff = peakAge - randomAge; bool adjust = StandardFunctions.CheckPercentageChance(50); //50% chance if (adjust) { int adjustValue = randomPeakDiff / 2; Age = randomAge + adjustValue; } else { Age = randomAge; } } else if (randomAge > peakAge) //If age is greater than peak age, chance of doing the opposite { int randomPeakDiff = randomAge - peakAge; bool adjust = StandardFunctions.CheckPercentageChance(50); //50% chance if (adjust) { int adjustValue = randomPeakDiff / 2; Age = randomAge + adjustValue; } else { Age = randomAge; } } else { Age = randomAge; } }
public static void CheckNextWeek() { GameController GameController = GameObject.Find("GameController").GetComponent <GameController> (); int nextWeekToPlan = GameController.TotalWeekCount + WeeksPlanned + 1; bool scheduleFight = RegularFightChance(); if (scheduleFight) { bool freeSlot = StandardFunctions.CheckPercentageChance(FreeSlotChance); MatchPlan newMatch = new MatchPlan(); newMatch.SetFightDate(nextWeekToPlan); SetFighters(newMatch, freeSlot); GameController.BookingManager.Calendar.Add(newMatch); } WeeksPlanned = WeeksPlanned++; }
public void LevelUp() { Level = Level + 1; MonoBehaviour.print(FirstName + " is now level " + Level + "!"); Attack = Attack + LevelUpSkillIncrease("attack"); Defense = Defense + LevelUpSkillIncrease("defense"); Magic = Magic + LevelUpSkillIncrease("magic"); Strategy = Strategy + LevelUpSkillIncrease("strategy"); Showcreatureship = Showcreatureship + LevelUpSkillIncrease("showcreatureship"); Comebackitude = Comebackitude + LevelUpSkillIncrease("comebackitude"); MaxHealth = MaxHealth + LevelUpHealthIncrease(); MaxEnergy = MaxEnergy + LevelUpEnergyIncrease(); if (StandardFunctions.CheckPercentageChance(BasicValues.fightMoneyCutLevelIncreaseChance)) { FightMoneyCut++; } ExperiencePoints = 0; }
public static bool RegularFightChance() { bool scheduleFight = StandardFunctions.CheckPercentageChance(RegularFightDefaultChance); return(scheduleFight); }