private static void PublishMessage(this MechComponent component, Text message, FloatieMessage.MessageNature nature) { var actor = component.parent; if (actor == null) { return; } var stackMessage = new AddSequenceToStackMessage(new ShowActorInfoSequence(actor, message, nature, true)); actor.Combat?.MessageCenter?.PublishMessage(stackMessage); }
public static void ShowMissChance(FloatieMessage __instance, FloatieMessage.MessageNature nature) { try { if (currentImpact == 0 || (nature != FloatieMessage.MessageNature.Miss && nature != FloatieMessage.MessageNature.MeleeMiss)) { return; } if (!hitChance.TryGetValue(currentImpact, out float chance)) { return; } __instance.SetText(new Localize.Text("Miss {0:0}%", new object[] { (currentRoll - chance) * 100 })); } catch (Exception ex) { Error(ex); } }
private static void ShowDamageFloatie(Vehicle vehicle, VehicleChassisLocations location, float damage, string sourceGUID) { if (vehicle != null && vehicle.GameRep != null) { Vector3 vector = vehicle.GameRep.GetHitPosition((int)location) + UnityEngine.Random.insideUnitSphere * 5f; FloatieMessage.MessageNature nature = vehicle.GetCurrentArmor(location) > 0f ? FloatieMessage.MessageNature.ArmorDamage : FloatieMessage.MessageNature.StructureDamage; FloatieMessage message = new FloatieMessage(sourceGUID, vehicle.GUID, $"{damage}", SharedState.Combat.Constants.CombatUIConstants.floatieSizeMedium, nature, vector.x, vector.y, vector.z); SharedState.Combat.MessageCenter.PublishMessage(message); } }
private static void ShowDamageFloatie(Turret turret, float damage, string sourceGUID) { if (turret != null && turret.GameRep != null) { Vector3 vector = turret.GameRep.GetHitPosition((int)BuildingLocation.Structure) + UnityEngine.Random.insideUnitSphere * 5f; FloatieMessage.MessageNature nature = turret.GetCurrentArmor(BuildingLocation.Structure) > 0f ? FloatieMessage.MessageNature.ArmorDamage : FloatieMessage.MessageNature.StructureDamage; FloatieMessage message = new FloatieMessage(sourceGUID, turret.GUID, $"{damage}", SharedState.Combat.Constants.CombatUIConstants.floatieSizeMedium, nature, vector.x, vector.y, vector.z); SharedState.Combat.MessageCenter.PublishMessage(message); } }
public static void Prefix(CombatHUDFloatieStack __instance, Text text, FloatieMessage.MessageNature nature) { try { //Logger.Debug($"[CombatHUDFloatieStack_AddFloatie_PREFIX] text: {text}"); //Logger.Debug($"[CombatHUDFloatieStack_AddFloatie_PREFIX] nature: {nature}"); if (nature == FloatieMessage.MessageNature.PilotInjury && Miscellaneous.TryGetStressLevelColor(text.ToString(), out Color color)) { Logger.Debug($"[CombatHUDFloatieStack_AddFloatie_PREFIX] SET override color for FloatieMessage.MessageNature.PilotInjury"); OverrideFloatiePilotDamage = true; OverrideFloatiePilotDamageColor = color; } } catch (Exception e) { Logger.Error(e); } }
private static MessageCenterMessage GetCritMessage(ICombatant unit, string message, object arg, FloatieMessage.MessageNature type) { return(new AddSequenceToStackMessage(new ShowActorInfoSequence(unit, new Text(message, new object[] { arg }), type, true))); }
internal static void PublishFloatieMessage(this AbstractActor actor, string text, FloatieMessage.MessageNature nature = FloatieMessage.MessageNature.CriticalHit) { actor.Combat.MessageCenter.PublishMessage(new FloatieMessage(actor.GUID, actor.GUID, text, nature)); }
internal static void PublishFloatieMessage(this Mech mech, string text, FloatieMessage.MessageNature nature = FloatieMessage.MessageNature.CriticalHit) { mech.Combat.MessageCenter.PublishMessage(new FloatieMessage(mech.GUID, mech.GUID, text, nature)); }
public static bool Prefix(CombatHUDFloatieStack __instance, ref Color __result, FloatieMessage.MessageNature nature) { try { if (nature == FloatieMessage.MessageNature.PilotInjury && OverrideFloatiePilotDamage) { Logger.Debug($"[CombatHUDFloatieStack_AddFloatie_PREFIX] OVERRIDING color for FloatieMessage.MessageNature.PilotInjury"); __result = OverrideFloatiePilotDamageColor; return(false); } if (nature == FloatieMessage.MessageNature.Inspiration) { Logger.Debug($"[CombatHUDFloatieStack_AddFloatie_PREFIX] OVERRIDING color for FloatieMessage.MessageNature.Inspiration"); __result = LazySingletonBehavior <UIManager> .Instance.UILookAndColorConstants.PilotInspired.color; return(false); } return(true); } catch (Exception e) { Logger.Error(e); return(true); } }
public static void Postfix(CombatHUDFloatieAnchor __instance, ref Color __result, FloatieMessage.MessageNature nature, UIManager ___uiManager) { try { // Streak locked-on if (nature == FloatieMessage.MessageNature.Suppression) { //__result = Fields.TargetingLaserColor; __result = ___uiManager.UIColorRefs.white; //__result = ___uiManager.UIColorRefs.green; } // Streak failed to connect else if (nature == FloatieMessage.MessageNature.Dodge) { __result = ___uiManager.UIColorRefs.structureDamaged; //__result = ___uiManager.UIColorRefs.orange; } } catch (Exception e) { Logger.Error(e); } }