-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
negative consequences for overdrive module
- Loading branch information
Showing
11 changed files
with
131 additions
and
10 deletions.
There are no files selected for viewing
Binary file not shown.
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
71 changes: 71 additions & 0 deletions
71
Source/WhatTheHack/Jobs/JobDriver_MechanoidAbility_Overdrive.cs
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,71 @@ | ||
using RimWorld; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using Verse; | ||
using WhatTheHack.Needs; | ||
|
||
namespace WhatTheHack.Jobs | ||
{ | ||
public class JobDriver_MechanoidAbility_Overdrive : JobDriver_MechanoidAbility | ||
{ | ||
protected override void FailAbility(DefModExtension_Ability modExt) | ||
{ | ||
base.FailAbility(modExt); | ||
Action[] actions = { this.GoneTooFar, this.MediumMaintenanceDamage, this.HighMaintenanceDamage}; | ||
List<Action> actionsList = actions.ToList(); | ||
Action action = actionsList.RandomElement(); | ||
action.Invoke(); | ||
} | ||
private void GoneTooFar() | ||
{ | ||
pawn.health.AddHediff(WTH_DefOf.WTH_Overdrive_GoneTooFar); | ||
if(pawn.Faction == Faction.OfPlayer) | ||
{ | ||
Find.LetterStack.ReceiveLetter("WTH_Letter_OverdiveGoneTooFar_Label".Translate(), "WTH_Letter_OverdiveGoneTooFar_Description".Translate(new object[] { pawn.Name.ToStringShort }), LetterDefOf.NeutralEvent, pawn); | ||
} | ||
|
||
} | ||
private void MediumMaintenanceDamage() | ||
{ | ||
Need_Maintenance need = pawn.needs.TryGetNeed<Need_Maintenance>(); | ||
if(need == null) | ||
{ | ||
return; | ||
} | ||
if (need.CurLevel > 25) | ||
{ | ||
need.CurLevel = 25; | ||
} | ||
else | ||
{ | ||
return; | ||
} | ||
if(pawn.Faction == Faction.OfPlayer) | ||
{ | ||
Find.LetterStack.ReceiveLetter("WTH_Letter_MediumMaintenanceDamage_Label".Translate(), "WTH_Letter_MediumMaintenanceDamage_Description".Translate(new object[] { pawn.Name.ToStringShort }), LetterDefOf.NegativeEvent, pawn); | ||
} | ||
} | ||
private void HighMaintenanceDamage() | ||
{ | ||
Need_Maintenance need = pawn.needs.TryGetNeed<Need_Maintenance>(); | ||
if (need == null) | ||
{ | ||
return; | ||
} | ||
if (need.CurLevel > 5) | ||
{ | ||
need.CurLevel = 5; | ||
} | ||
else | ||
{ | ||
return; | ||
} | ||
if(pawn.Faction == Faction.OfPlayer) | ||
{ | ||
Find.LetterStack.ReceiveLetter("WTH_Letter_HackedPoorlyEvent_Label".Translate(), "WTH_Letter_HighMaintenanceDamage_Description".Translate(new object[] { pawn.Name.ToStringShort }), LetterDefOf.ThreatBig, pawn); | ||
} | ||
} | ||
} | ||
} |
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