-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e3521f2
commit c1e4ff6
Showing
15 changed files
with
208 additions
and
77 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
using System.Linq; | ||
|
||
namespace Bureaucracy | ||
{ | ||
public class FireEvent : RandomEventBase | ||
{ | ||
private readonly BureaucracyFacility facilityToBurn; | ||
public FireEvent() | ||
{ | ||
facilityToBurn = FacilityManager.Instance.Facilities.ElementAt(Utilities.Instance.Randomise.Next(0, FacilityManager.Instance.Facilities.Count)); | ||
title = "Fire!"; | ||
body = "Recent cutbacks have resulted in poor safety protocols at " + facilityToBurn.Name + ". As a result, a small fire has gotten out of control"; | ||
acceptString = "Oh dear. (" + facilityToBurn.Name + " is destroyed)"; | ||
CanBeDeclined = false; | ||
} | ||
public override bool EventCanFire() | ||
{ | ||
if (Utilities.Instance.Randomise.NextDouble() > FacilityManager.Instance.FireChance) return false; | ||
return facilityToBurn.CanBeDestroyed(); | ||
} | ||
|
||
protected override void OnEventAccepted() | ||
{ | ||
facilityToBurn.DestroyBuilding(); | ||
} | ||
|
||
protected override void OnEventDeclined() | ||
{ | ||
|
||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
using System.Linq; | ||
|
||
namespace Bureaucracy | ||
{ | ||
public class WageEvent : RandomEventBase | ||
{ | ||
private CrewMember crewMember; | ||
|
||
public WageEvent(ConfigNode eventNode) | ||
{ | ||
CrewMember c = FindCrew(); | ||
if (c == null) return; | ||
crewMember = c; | ||
LoadConfig(eventNode); | ||
body = body.Replace("<crew>", c.Name); | ||
acceptString = acceptString.Replace("<crew>", c.Name); | ||
} | ||
|
||
private CrewMember FindCrew() | ||
{ | ||
if (CrewManager.Instance.Kerbals.Count == 0) return null; | ||
int i = Utilities.Instance.Randomise.Next(0, CrewManager.Instance.Kerbals.Count); | ||
CrewMember c = CrewManager.Instance.Kerbals.ElementAt(i).Value; | ||
return c; | ||
} | ||
|
||
public override bool EventCanFire() | ||
{ | ||
if (crewMember.CrewReference().rosterStatus != ProtoCrewMember.RosterStatus.Available) return false; | ||
if (crewMember.WageModifier <= 1.0f && EventEffect < 0.0f) return false; | ||
return true; | ||
} | ||
|
||
protected override void OnEventAccepted() | ||
{ | ||
crewMember.WageModifier += EventEffect; | ||
} | ||
|
||
protected override void OnEventDeclined() | ||
{ | ||
|
||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters