public override void DoPostConfigureComplete(GameObject go) { RanchStation.Def def = go.AddOrGetDef <RanchStation.Def>(); def.isCreatureEligibleToBeRanchedCb = ((GameObject creature_go, RanchStation.Instance ranch_station_smi) => creature_go.GetSMI <ScaleGrowthMonitor.Instance>()?.IsFullyGrown() ?? false); def.onRanchCompleteCb = delegate(GameObject creature_go) { creature_go.GetSMI <ScaleGrowthMonitor.Instance>().Shear(); }; def.interactLoopCount = 6; def.rancherInteractAnim = "anim_interacts_shearingstation_kanim"; def.synchronizeBuilding = true; Prioritizable.AddRef(go); }
public override void DoPostConfigureComplete(GameObject go) { RanchStation.Def def = go.AddOrGetDef <RanchStation.Def>(); def.isCreatureEligibleToBeRanchedCb = delegate(GameObject creature_go, RanchStation.Instance ranch_station_smi) { ButcherStation butcherStation = ranch_station_smi.GetComponent <ButcherStation>(); if (butcherStation != null) { return(butcherStation.IsCreatureEligibleToBeButched(creature_go)); } return(false); }; def.onRanchCompleteCb = delegate(GameObject creature_go) { /* * RanchStation.Instance smi = creature_go.GetSMI<RanchableMonitor.Instance>()?.targetRanchStation; * if (smi != null) * { * creature_go.transform.SetPosition(smi.transform.GetPosition()); * } * creature_go.GetSMI<DeathMonitor.Instance>()?.Kill(Db.Get().Deaths.Generic); */ ButcherStation.ButchCreature(creature_go, true); }; def.getTargetRanchCell = delegate(RanchStation.Instance smi) { int num = Grid.InvalidCell; if (!smi.IsNullOrStopped()) { bool water; num = Grid.CellBelow(Grid.PosToCell(smi.transform.GetPosition())); num = Grid.OffsetCell(num, 0, -FishingStationGuide.GetDepthAvailable(smi.gameObject, out water)); } return(num); }; def.interactLoopCount = 1; def.rancherInteractAnim = "anim_interacts_fishingstation_kanim"; def.ranchedPreAnim = "bitehook"; def.ranchedLoopAnim = "caught_loop"; def.ranchedPstAnim = "trapped_pre"; def.synchronizeBuilding = true; Prioritizable.AddRef(go); AddGuide(go: go.GetComponent <Building>().Def.BuildingPreview, preview: true, occupy_tiles: false); AddGuide(go: go.GetComponent <Building>().Def.BuildingPreview, foundament: true); AddGuide(go: go.GetComponent <Building>().Def.BuildingUnderConstruction, preview: true, occupy_tiles: true); AddGuide(go: go.GetComponent <Building>().Def.BuildingUnderConstruction, foundament: true); AddGuide(go: go.GetComponent <Building>().Def.BuildingComplete, preview: false, occupy_tiles: true); }
public override void DoPostConfigureComplete(GameObject go) { RanchStation.Def def = go.AddOrGetDef <RanchStation.Def>(); def.isCreatureEligibleToBeRanchedCb = delegate(GameObject creature_go, RanchStation.Instance ranch_station_smi) { ButcherStation butcherStation = ranch_station_smi.GetComponent <ButcherStation>(); if (butcherStation != null) { return(butcherStation.IsCreatureEligibleToBeButched(creature_go)); } return(false); }; def.onRanchCompleteCb = delegate(GameObject creature_go) { //creature_go.GetSMI<DeathMonitor.Instance>()?.Kill(Db.Get().Deaths.Generic); ButcherStation.ButchCreature(creature_go); }; def.getTargetRanchCell = delegate(RanchStation.Instance smi) { int num = Grid.InvalidCell; if (!smi.IsNullOrStopped()) { num = Grid.PosToCell(smi.transform.GetPosition()); if (!smi.targetRanchable.IsNullOrStopped()) { if (smi.targetRanchable.HasTag(GameTags.Creatures.Flyer)) { num = Grid.CellAbove(num); } } } return(num); }; def.interactLoopCount = 2; def.rancherInteractAnim = "anim_interacts_shearingstation_kanim"; def.ranchedPreAnim = "grooming_pre"; //def.ranchedLoopAnim = "grooming_loop"; def.ranchedLoopAnim = "hit"; def.ranchedPstAnim = "grooming_pst"; def.synchronizeBuilding = true; Prioritizable.AddRef(go); }
public override void DoPostConfigureComplete(GameObject go) { GeneratedBuildings.RegisterLogicPorts(go, LogicOperationalController.INPUT_PORTS_0_0); go.AddOrGet <LogicOperationalController>(); RanchStation.Def def = go.AddOrGetDef <RanchStation.Def>(); def.isCreatureEligibleToBeRanchedCb = ((GameObject creature_go, RanchStation.Instance ranch_station_smi) => !creature_go.GetComponent <Effects>().HasEffect("Ranched")); def.onRanchCompleteCb = delegate(GameObject creature_go) { RanchableMonitor.Instance sMI = creature_go.GetSMI <RanchableMonitor.Instance>(); RanchStation.Instance targetRanchStation = sMI.targetRanchStation; RancherChore.RancherChoreStates.Instance sMI2 = targetRanchStation.GetSMI <RancherChore.RancherChoreStates.Instance>(); GameObject go2 = targetRanchStation.GetSMI <RancherChore.RancherChoreStates.Instance>().sm.rancher.Get(sMI2); float num2 = 1f + go2.GetAttributes().Get(Db.Get().Attributes.Ranching.Id).GetTotalValue() * 0.1f; creature_go.GetComponent <Effects>().Add("Ranched", true).timeRemaining *= num2; }; def.ranchedPreAnim = "grooming_pre"; def.ranchedLoopAnim = "grooming_loop"; def.ranchedPstAnim = "grooming_pst"; def.getTargetRanchCell = delegate(RanchStation.Instance smi) { int num = Grid.InvalidCell; if (!smi.IsNullOrStopped()) { num = Grid.CellRight(Grid.PosToCell(smi.transform.GetPosition())); if (!smi.targetRanchable.IsNullOrStopped() && smi.targetRanchable.HasTag(GameTags.Creatures.Flyer)) { num = Grid.CellAbove(num); } } return(num); }; RoomTracker roomTracker = go.AddOrGet <RoomTracker>(); roomTracker.requiredRoomType = Db.Get().RoomTypes.CreaturePen.Id; roomTracker.requirement = RoomTracker.Requirement.Required; SkillPerkMissingComplainer skillPerkMissingComplainer = go.AddOrGet <SkillPerkMissingComplainer>(); skillPerkMissingComplainer.requiredSkillPerk = Db.Get().SkillPerks.CanWrangleCreatures.Id; Prioritizable.AddRef(go); }
public static void Postfix(GameObject go) { RanchStation.Def def = go.AddOrGetDef <RanchStation.Def>(); def.isCreatureEligibleToBeRanchedCb = isCreatureEligibleToBeRanched; def.onRanchCompleteCb = onRanchComplete; }