-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adds roping confused (low consciousness) zombies
- Loading branch information
Showing
20 changed files
with
254 additions
and
42 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
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,39 @@ | ||
using System.Collections.Generic; | ||
using Verse; | ||
using Verse.AI; | ||
|
||
namespace ZombieLand | ||
{ | ||
public class JobDriver_RopeZombie : JobDriver | ||
{ | ||
bool ZombieIsRopable() | ||
{ | ||
var thing = job.GetTarget(TargetIndex.A).Thing; | ||
if (!(thing is Zombie zombie) || zombie.Destroyed || zombie.Spawned == false) | ||
return false; | ||
return zombie.ropedBy == null; | ||
} | ||
|
||
public override bool TryMakePreToilReservations(bool errorOnFailed) | ||
{ | ||
var thing = job.GetTarget(TargetIndex.A).Thing; | ||
if (pawn.CanReach(job.GetTarget(TargetIndex.A), PathEndMode.Touch, Danger.Deadly) == false) | ||
return false; | ||
return ZombieIsRopable(); | ||
} | ||
|
||
public override IEnumerable<Toil> MakeNewToils() | ||
{ | ||
_ = this.FailOnDespawnedOrNull(TargetIndex.A); | ||
yield return Toils_Goto.GotoThing(TargetIndex.A, PathEndMode.Touch); | ||
yield return new Toil | ||
{ | ||
initAction = delegate () | ||
{ | ||
var zombie = job.GetTarget(TargetIndex.A).Thing as Zombie; | ||
zombie.ropedBy = 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
Oops, something went wrong.