/// <summary> /// Default mishap implmentation, other careers and genre's can /// override this for specific mishap effects /// </summary> /// <returns></returns> protected virtual SurvivalResult ResolveMishap() { SurvivalResult survive = SurvivalResult.Survived; switch (dice.roll(1)) { case 1: Owner.Journal.Add(Resources.Msg_InjuredInAction); ResolveInjury(2); break; case 2: Owner.Journal.Add(Resources.Msg_HonourablyDischarged); Owner.Age += 4; survive = SurvivalResult.Discharged; break; case 3: Owner.Journal.Add(Resources.Msg_HonourablyDischargedLegal); Owner.Age += 4; Owner.AddBenefit( new Benefit() { Name = Properties.Resources.Benefit_Cash, TypeOfBenefit = Benefit.BenefitType.Cash, Value = -10000 } ); survive = SurvivalResult.Discharged; break; case 4: Owner.Journal.Add(Resources.Msg_DishonourablyDischarged); lostBenefits = true; Owner.Age += 4; survive = SurvivalResult.Discharged; break; case 5: Owner.Journal.Add(Resources.Msg_DishonourablyDischargedPrison); Owner.Age += 8; lostBenefits = true; survive = SurvivalResult.Discharged; break; case 6: Owner.Journal.Add(Resources.Msg_MedicallyDischarged); Owner.Age += 2; ResolveInjury(0); survive = SurvivalResult.Discharged; break; } return(survive); }
public virtual void MusterOut() { if (Retired) { if (TermsServed > 4) { int pension = ((TermsServed - 4) * 2000) + 2000; if (Owner.Culture == Constants.CultureType.Zhodani && Owner.Profile.Soc.Value > 10) { pension *= 2; } Owner.AddBenefit(new Benefit() { Name = Properties.Resources.Benefit_RetirementPay, Value = pension, TypeOfBenefit = Benefit.BenefitType.Material }); } } }
public void ResolveCashBenefit() { var roll = dice.roll(); if (Owner.Skills.ContainsKey(SkillLibrary.Gambling.Name) || Owner.Skills.ContainsKey(SkillLibrary.Prospecting.Name) || Retired) { roll++; } if (Owner.Culture == Constants.CultureType.Aslan) { if (Owner.Skills.ContainsKey(SkillLibrary.Independance.Name) && Owner.Skills[SkillLibrary.Independance.Name].Level >= 3) { roll++; } } roll = roll.Clamp(1, Cash.Length); Owner.AddBenefit(new Benefit() { Name = Properties.Resources.Benefit_Cash, Value = Cash[roll - 1], TypeOfBenefit = Benefit.BenefitType.Cash }); }
public BenefitResolution ResolveMaterialBenefit() { var result = new BenefitResolution() { pick = BenefitPick.None }; var roll = dice.roll(); if (Owner.Culture == Constants.CultureType.Darrian) { if (RankNumber >= 5 || Owner.Profile.Soc.Value >= 11) { roll++; } } else if (Owner.Culture == Constants.CultureType.Aslan) { if (Owner.Profile.Soc.Value >= 9) { roll++; } if (Owner.Sex.Equals(Properties.Resources.Sex_Male)) { roll++; } } else { if (RankNumber >= 5 || Owner.Skills.ContainsKey(SkillLibrary.Prospecting.Name)) { roll++; } } roll = roll.Clamp(1, Material.Count); var benefit = Material[roll - 1]; result.benefit = benefit; if (Culture.BenefitAllowed(Owner, benefit)) { if (benefit.TypeOfBenefit == Benefit.BenefitType.Material) { Owner.AddBenefit(benefit); } else if (benefit.TypeOfBenefit == Benefit.BenefitType.Skill) { Owner.AddSkill(new Skill() { Class = Skill.SkillClass.None, Name = benefit.Name, Level = benefit.Value }); } else if (benefit.TypeOfBenefit == Benefit.BenefitType.AttributeModification) { Owner.AddAttribute(benefit.Name, benefit.Value); } else if (benefit.TypeOfBenefit == Benefit.BenefitType.Weapon) { result.pick = ResolveWeaponBenefit(); } else if (benefit.TypeOfBenefit != Benefit.BenefitType.None) { Owner.AddBenefit(benefit); } } else { Owner.Journal.Add(string.Format(Properties.Resources.Msg_BenefitNotAllowed, benefit.Name, benefit.Value)); } return(result); }