///// <summary> ///// Prevents the user from having damage with the verb. ///// </summary> ///// <param name="__instance"></param> ///// <param name="__result"></param> ///// <param name="pawn"></param> //public static void GetDamageFactorForPostFix(Verb __instance, ref float __result, Pawn pawn) //{ // Pawn_EquipmentTracker pawn_EquipmentTracker = pawn.equipment; // if (pawn_EquipmentTracker != null) // { // //Log.Message("2"); // ThingWithComps thingWithComps = (ThingWithComps)AccessTools.Field(typeof(Pawn_EquipmentTracker), "primaryInt").GetValue(pawn_EquipmentTracker); // if (thingWithComps != null) // { // //Log.Message("3"); // CompActivatableEffect compActivatableEffect = thingWithComps.GetComp<CompActivatableEffect>(); // if (compActivatableEffect != null) // { // if (compActivatableEffect.CurrentState != CompActivatableEffect.State.Activated) // { // //Messages.Message("DeactivatedWarning".Translate(), MessageSound.RejectInput); // __result = 0f; // } // } // } // } //} /// <summary> /// Adds another "layer" to the equipment aiming if they have a /// weapon with a CompActivatableEffect. /// </summary> public static IEnumerable <Gizmo> GizmoGetter(OgsCompActivatableEffect.CompActivatableEffect compActivatableEffect) { if (compActivatableEffect.GizmosOnEquip) { var enumerator = compActivatableEffect.EquippedGizmos().GetEnumerator(); while (enumerator.MoveNext()) { var current = enumerator.Current; yield return(current); } } }
public static IEnumerable <Gizmo> GizmoGetter(OgsCompActivatableEffect.CompActivatableEffect compActivatableEffect) { //Log.Message("5"); if (compActivatableEffect.GizmosOnEquip) { //Log.Message("6"); //Iterate EquippedGizmos var enumerator = compActivatableEffect.EquippedGizmos().GetEnumerator(); while (enumerator.MoveNext()) { //Log.Message("7"); var current = enumerator.Current; yield return(current); } } }