From b8c423fe5a6a177aae9984d03d225d9899c1ea7b Mon Sep 17 00:00:00 2001 From: CMDR-Bill-Doors Date: Fri, 6 Sep 2024 08:01:48 +0100 Subject: [PATCH 1/5] init commit --- .../ThingDefs_Races/AlienRace_Miho.xml | 246 +++++++++--------- .../CombatExtended/Comps_CCL/CompPawnGizmo.cs | 57 ++-- 2 files changed, 160 insertions(+), 143 deletions(-) diff --git a/ModPatches/Miho Race/Patches/Miho Race/ThingDefs_Races/AlienRace_Miho.xml b/ModPatches/Miho Race/Patches/Miho Race/ThingDefs_Races/AlienRace_Miho.xml index 7285d4bebb..eefd4eef01 100644 --- a/ModPatches/Miho Race/Patches/Miho Race/ThingDefs_Races/AlienRace_Miho.xml +++ b/ModPatches/Miho Race/Patches/Miho Race/ThingDefs_Races/AlienRace_Miho.xml @@ -1,132 +1,132 @@ - - Defs/AlienRace.ThingDef_AlienRace[defName="Alien_Miho"]/comps - - Defs/AlienRace.ThingDef_AlienRace[defName="Alien_Miho"]/comps - -
  • - CombatExtended.CompPawnGizmo -
  • -
  • -
  • - 500 - true - 600 - 5 - 0.75 -
  • -
    -
    - - Defs/AlienRace.ThingDef_AlienRace[defName="Alien_Miho"] - - -
  • - CombatExtended.CompPawnGizmo -
  • -
  • -
  • - 500 - true - 600 - 5 - 0.75 -
  • -
    -
    -
    -
    + + Defs/AlienRace.ThingDef_AlienRace[defName="Alien_Miho"]/comps + + Defs/AlienRace.ThingDef_AlienRace[defName="Alien_Miho"]/comps + +
  • + CombatExtended.CompPawnGizmo +
  • +
  • +
  • + 500 + true + 600 + 5 + 0.75 +
  • +
    +
    + + Defs/AlienRace.ThingDef_AlienRace[defName="Alien_Miho"] + + +
  • + CombatExtended.CompPawnGizmo +
  • +
  • +
  • + 500 + true + 600 + 5 + 0.75 +
  • +
    +
    +
    +
    - - Defs/AlienRace.ThingDef_AlienRace[defName="Alien_Miho"] - -
  • - Humanoid -
  • -
    -
    + + Defs/AlienRace.ThingDef_AlienRace[defName="Alien_Miho"] + +
  • + Humanoid +
  • +
    +
    - - Defs/AlienRace.ThingDef_AlienRace[defName="Alien_Miho"]/statBases/MeleeDodgeChance - - 0.5 - 1 - 0.5 - 0.75 - - + + Defs/AlienRace.ThingDef_AlienRace[defName="Alien_Miho"]/statBases/MeleeDodgeChance + + 0.5 + 1 + 0.5 + 0.75 + + - - Defs/AlienRace.ThingDef_AlienRace[defName="Alien_Miho"]/tools - - -
  • - - -
  • Blunt
  • - - 1 - 1.26 - LeftHand - 0.250 - -
  • - - -
  • Blunt
  • - - 1 - 1.26 - RightHand - 0.250 - -
  • - - -
  • Blunt
  • - - 2 - 4.49 - HeadAttackTool - 0.2 - 0.625 - -
    -
    -
    + + Defs/AlienRace.ThingDef_AlienRace[defName="Alien_Miho"]/tools + + +
  • + + +
  • Blunt
  • + + 1 + 1.26 + LeftHand + 0.250 + +
  • + + +
  • Blunt
  • + + 1 + 1.26 + RightHand + 0.250 + +
  • + + +
  • Blunt
  • + + 2 + 4.49 + HeadAttackTool + 0.2 + 0.625 + +
    +
    +
    - - Defs/AlienRace.ThingDef_AlienRace[defName="Alien_Miho"]/damageMultipliers - -
  • - PrometheumFlame - 0.25 -
  • -
  • - Flame_Secondary - 0.25 -
  • -
    -
    + + Defs/AlienRace.ThingDef_AlienRace[defName="Alien_Miho"]/damageMultipliers + +
  • + PrometheumFlame + 0.25 +
  • +
  • + Flame_Secondary + 0.25 +
  • +
    +
    - - Defs/AlienRace.ThingDef_AlienRace[defName="Alien_Miho"]/alienRace/raceRestriction/whiteApparelList - -
  • CE_Apparel_TacVest
  • -
  • CE_Apparel_Backpack
  • -
  • CE_Apparel_TribalBackpack
  • -
  • CE_Apparel_BallisticShield
  • -
  • CE_Apparel_MeleeShield
  • -
  • CE_Apparel_GasMask
  • -
  • CE_Apparel_ImprovGasMask
  • -
    -
    + + Defs/AlienRace.ThingDef_AlienRace[defName="Alien_Miho"]/alienRace/raceRestriction/whiteApparelList + +
  • CE_Apparel_TacVest
  • +
  • CE_Apparel_Backpack
  • +
  • CE_Apparel_TribalBackpack
  • +
  • CE_Apparel_BallisticShield
  • +
  • CE_Apparel_MeleeShield
  • +
  • CE_Apparel_GasMask
  • +
  • CE_Apparel_ImprovGasMask
  • +
    +
    - - Defs/GeneDef[defName="Ears_Arctic_Miho"]/statOffsets - - 10 - - + + Defs/GeneDef[defName="Ears_Arctic_Miho"]/statOffsets + + 10 + +
    \ No newline at end of file diff --git a/Source/CombatExtended/CombatExtended/Comps_CCL/CompPawnGizmo.cs b/Source/CombatExtended/CombatExtended/Comps_CCL/CompPawnGizmo.cs index e788dedcb8..0d986e97fc 100644 --- a/Source/CombatExtended/CombatExtended/Comps_CCL/CompPawnGizmo.cs +++ b/Source/CombatExtended/CombatExtended/Comps_CCL/CompPawnGizmo.cs @@ -5,35 +5,52 @@ namespace CombatExtended { public class CompPawnGizmo : ThingComp { - public override IEnumerable CompGetGizmosExtra() + bool duplicate = false; + + public override void Initialize(CompProperties props) { - var pawn = parent as Pawn; - var equip = pawn != null - ? pawn.equipment.Primary - : null; + base.Initialize(props); + foreach (var comp in parent.comps) + { + if (comp is CompPawnGizmo && comp != this) + { + duplicate = true; + Log.ErrorOnce($"{parent.def.defName} has multiple CompPawnGizmo, duplicates has been deactivated. Please report this to the patch provider of ${parent.def.modContentPack.Name} or CE team if the patch is integrated in CE.", parent.def.GetHashCode()); + } + } + } - if ( - (equip != null) && - (!equip.AllComps.NullOrEmpty()) - ) + + public override IEnumerable CompGetGizmosExtra() + { + if (!duplicate) { - foreach (var comp in equip.AllComps) + var pawn = parent as Pawn; + var equip = pawn != null + ? pawn.equipment.Primary + : null; + + if ( + (equip != null) && + (!equip.AllComps.NullOrEmpty()) + ) { - var gizmoGiver = comp as CompRangedGizmoGiver; - if ( - (gizmoGiver != null) && - (gizmoGiver.isRangedGiver) - ) + foreach (var comp in equip.AllComps) { - foreach (var gizmo in gizmoGiver.CompGetGizmosExtra()) + var gizmoGiver = comp as CompRangedGizmoGiver; + if ( + (gizmoGiver != null) && + (gizmoGiver.isRangedGiver) + ) { - yield return gizmo; + foreach (var gizmo in gizmoGiver.CompGetGizmosExtra()) + { + yield return gizmo; + } } } } - } + }; } - } - } From 287ea7e2ffe61fcd1b0b24545c595364dbe32af7 Mon Sep 17 00:00:00 2001 From: CMDR-Bill-Doors Date: Fri, 6 Sep 2024 08:09:54 +0100 Subject: [PATCH 2/5] oopsie --- .../Patches/Miho Race/ThingDefs_Races/AlienRace_Miho.xml | 3 --- .../CombatExtended/CombatExtended/Comps_CCL/CompPawnGizmo.cs | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/ModPatches/Miho Race/Patches/Miho Race/ThingDefs_Races/AlienRace_Miho.xml b/ModPatches/Miho Race/Patches/Miho Race/ThingDefs_Races/AlienRace_Miho.xml index eefd4eef01..4be7b56a6d 100644 --- a/ModPatches/Miho Race/Patches/Miho Race/ThingDefs_Races/AlienRace_Miho.xml +++ b/ModPatches/Miho Race/Patches/Miho Race/ThingDefs_Races/AlienRace_Miho.xml @@ -5,9 +5,6 @@ Defs/AlienRace.ThingDef_AlienRace[defName="Alien_Miho"]/comps -
  • - CombatExtended.CompPawnGizmo -
  • 500 diff --git a/Source/CombatExtended/CombatExtended/Comps_CCL/CompPawnGizmo.cs b/Source/CombatExtended/CombatExtended/Comps_CCL/CompPawnGizmo.cs index 0d986e97fc..33f222d45b 100644 --- a/Source/CombatExtended/CombatExtended/Comps_CCL/CompPawnGizmo.cs +++ b/Source/CombatExtended/CombatExtended/Comps_CCL/CompPawnGizmo.cs @@ -15,7 +15,7 @@ public override void Initialize(CompProperties props) if (comp is CompPawnGizmo && comp != this) { duplicate = true; - Log.ErrorOnce($"{parent.def.defName} has multiple CompPawnGizmo, duplicates has been deactivated. Please report this to the patch provider of ${parent.def.modContentPack.Name} or CE team if the patch is integrated in CE.", parent.def.GetHashCode()); + Log.ErrorOnce($"{parent.def.defName} has multiple CompPawnGizmo, duplicates has been deactivated. Please report this to the patch provider of {parent.def.modContentPack.Name} or CE team if the patch is integrated in CE.", parent.def.GetHashCode()); } } } From 045ef80ffdbe40a19479fc0a63cdb1eb3a5946fc Mon Sep 17 00:00:00 2001 From: CMDR-Bill-Doors Date: Fri, 6 Sep 2024 08:15:43 +0100 Subject: [PATCH 3/5] wait, there's another CPG --- .../Patches/Miho Race/ThingDefs_Races/AlienRace_Miho.xml | 3 --- 1 file changed, 3 deletions(-) diff --git a/ModPatches/Miho Race/Patches/Miho Race/ThingDefs_Races/AlienRace_Miho.xml b/ModPatches/Miho Race/Patches/Miho Race/ThingDefs_Races/AlienRace_Miho.xml index 4be7b56a6d..224ad9d530 100644 --- a/ModPatches/Miho Race/Patches/Miho Race/ThingDefs_Races/AlienRace_Miho.xml +++ b/ModPatches/Miho Race/Patches/Miho Race/ThingDefs_Races/AlienRace_Miho.xml @@ -19,9 +19,6 @@ Defs/AlienRace.ThingDef_AlienRace[defName="Alien_Miho"] -
  • - CombatExtended.CompPawnGizmo -
  • 500 From 73a17cc063c22ebad0ee79e119599571503ad54f Mon Sep 17 00:00:00 2001 From: n7huntsman Date: Mon, 9 Sep 2024 01:22:02 -0400 Subject: [PATCH 4/5] Fix whitespace --- .../ThingDefs_Races/AlienRace_Miho.xml | 234 +++++++++--------- 1 file changed, 117 insertions(+), 117 deletions(-) diff --git a/ModPatches/Miho Race/Patches/Miho Race/ThingDefs_Races/AlienRace_Miho.xml b/ModPatches/Miho Race/Patches/Miho Race/ThingDefs_Races/AlienRace_Miho.xml index 224ad9d530..c438f3ebf2 100644 --- a/ModPatches/Miho Race/Patches/Miho Race/ThingDefs_Races/AlienRace_Miho.xml +++ b/ModPatches/Miho Race/Patches/Miho Race/ThingDefs_Races/AlienRace_Miho.xml @@ -1,126 +1,126 @@ - - Defs/AlienRace.ThingDef_AlienRace[defName="Alien_Miho"]/comps - - Defs/AlienRace.ThingDef_AlienRace[defName="Alien_Miho"]/comps - -
  • -
  • - 500 - true - 600 - 5 - 0.75 -
  • -
    -
    - - Defs/AlienRace.ThingDef_AlienRace[defName="Alien_Miho"] - - -
  • -
  • - 500 - true - 600 - 5 - 0.75 -
  • -
    -
    -
    - + + Defs/AlienRace.ThingDef_AlienRace[defName="Alien_Miho"]/comps + + Defs/AlienRace.ThingDef_AlienRace[defName="Alien_Miho"]/comps + +
  • +
  • + 500 + true + 600 + 5 + 0.75 +
  • +
    +
    + + Defs/AlienRace.ThingDef_AlienRace[defName="Alien_Miho"] + + +
  • +
  • + 500 + true + 600 + 5 + 0.75 +
  • +
    +
    +
    +
    - - Defs/AlienRace.ThingDef_AlienRace[defName="Alien_Miho"] - -
  • - Humanoid -
  • -
    -
    + + Defs/AlienRace.ThingDef_AlienRace[defName="Alien_Miho"] + +
  • + Humanoid +
  • +
    +
    - - Defs/AlienRace.ThingDef_AlienRace[defName="Alien_Miho"]/statBases/MeleeDodgeChance - - 0.5 - 1 - 0.5 - 0.75 - - + + Defs/AlienRace.ThingDef_AlienRace[defName="Alien_Miho"]/statBases/MeleeDodgeChance + + 0.5 + 1 + 0.5 + 0.75 + + - - Defs/AlienRace.ThingDef_AlienRace[defName="Alien_Miho"]/tools - - -
  • - - -
  • Blunt
  • - - 1 - 1.26 - LeftHand - 0.250 - -
  • - - -
  • Blunt
  • - - 1 - 1.26 - RightHand - 0.250 - -
  • - - -
  • Blunt
  • - - 2 - 4.49 - HeadAttackTool - 0.2 - 0.625 - -
    -
    -
    + + Defs/AlienRace.ThingDef_AlienRace[defName="Alien_Miho"]/tools + + +
  • + + +
  • Blunt
  • + + 1 + 1.26 + LeftHand + 0.250 + +
  • + + +
  • Blunt
  • + + 1 + 1.26 + RightHand + 0.250 + +
  • + + +
  • Blunt
  • + + 2 + 4.49 + HeadAttackTool + 0.2 + 0.625 + +
    +
    +
    - - Defs/AlienRace.ThingDef_AlienRace[defName="Alien_Miho"]/damageMultipliers - -
  • - PrometheumFlame - 0.25 -
  • -
  • - Flame_Secondary - 0.25 -
  • -
    -
    + + Defs/AlienRace.ThingDef_AlienRace[defName="Alien_Miho"]/damageMultipliers + +
  • + PrometheumFlame + 0.25 +
  • +
  • + Flame_Secondary + 0.25 +
  • +
    +
    - - Defs/AlienRace.ThingDef_AlienRace[defName="Alien_Miho"]/alienRace/raceRestriction/whiteApparelList - -
  • CE_Apparel_TacVest
  • -
  • CE_Apparel_Backpack
  • -
  • CE_Apparel_TribalBackpack
  • -
  • CE_Apparel_BallisticShield
  • -
  • CE_Apparel_MeleeShield
  • -
  • CE_Apparel_GasMask
  • -
  • CE_Apparel_ImprovGasMask
  • -
    -
    + + Defs/AlienRace.ThingDef_AlienRace[defName="Alien_Miho"]/alienRace/raceRestriction/whiteApparelList + +
  • CE_Apparel_TacVest
  • +
  • CE_Apparel_Backpack
  • +
  • CE_Apparel_TribalBackpack
  • +
  • CE_Apparel_BallisticShield
  • +
  • CE_Apparel_MeleeShield
  • +
  • CE_Apparel_GasMask
  • +
  • CE_Apparel_ImprovGasMask
  • +
    +
    - - Defs/GeneDef[defName="Ears_Arctic_Miho"]/statOffsets - - 10 - - + + Defs/GeneDef[defName="Ears_Arctic_Miho"]/statOffsets + + 10 + + \ No newline at end of file From 25cfa06c49c41843d73cb85a05693a7f32b23db8 Mon Sep 17 00:00:00 2001 From: n7huntsman Date: Mon, 9 Sep 2024 01:22:29 -0400 Subject: [PATCH 5/5] A bit more whitespace policing --- .../Patches/Miho Race/ThingDefs_Races/AlienRace_Miho.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ModPatches/Miho Race/Patches/Miho Race/ThingDefs_Races/AlienRace_Miho.xml b/ModPatches/Miho Race/Patches/Miho Race/ThingDefs_Races/AlienRace_Miho.xml index c438f3ebf2..86f263df73 100644 --- a/ModPatches/Miho Race/Patches/Miho Race/ThingDefs_Races/AlienRace_Miho.xml +++ b/ModPatches/Miho Race/Patches/Miho Race/ThingDefs_Races/AlienRace_Miho.xml @@ -21,7 +21,7 @@
  • - 500 + 500 true 600 5