Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using GlobalEnums;
- using Modding;
- using Vasi;
- namespace FallDamageMod {
- public class FallDamageMod : Mod {
- public override void Initialize() {
- On.HeroController.DoHardLanding += HardLand;
- On.PlayMakerFSM.OnEnable += ModifyFSM;
- }
- private void ModifyFSM(On.PlayMakerFSM.orig_OnEnable orig, PlayMakerFSM self) {
- if (self.FsmName == "Control" && self.name == "Initial Fall Impact") {
- self.GetState("Land").AddMethod(() => Die(HeroController.instance));
- }
- orig(self);
- }
- private void HardLand(On.HeroController.orig_DoHardLanding orig, HeroController self) {
- Die(self);
- }
- private void Die(HeroController hc) {
- hc.TakeDamage(hc.gameObject, CollisionSide.bottom, 9999, 0);
- }
- public override string GetVersion() {
- return "1.0";
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment