예제 #1
0
 public CompOversizedWeapon()
 {
     if (!(props is CompProperties_OversizedWeapon))
     {
         props = new CompProperties_OversizedWeapon();
     }
 }
예제 #2
0
        private static float AngleOffsetAtPeace(Thing eq, bool isFighting, CompProperties_OversizedWeapon props)
        {
            var offsetAtPeace = eq.def.equippedAngleOffset;

            if (!isFighting && props != null && props.verticalFlipOutsideCombat)
            {
                offsetAtPeace += 180f;
            }
            return(offsetAtPeace);
        }
예제 #3
0
 private static Vector3 OffsetFromRotation(Rot4 rotation, CompProperties_OversizedWeapon props)
 {
     if (rotation == Rot4.North)
     {
         return(props.northOffset);
     }
     else if (rotation == Rot4.East)
     {
         return(props.eastOffset);
     }
     else if (rotation == Rot4.West)
     {
         return(props.westOffset);
     }
     else
     {
         return(props.southOffset);
     }
 }
예제 #4
0
 private static float NonCombatAngleAdjustment(Rot4 rotation, CompProperties_OversizedWeapon props)
 {
     if (rotation == Rot4.North)
     {
         return(props.angleAdjustmentNorth);
     }
     else if (rotation == Rot4.East)
     {
         return(props.angleAdjustmentEast);
     }
     else if (rotation == Rot4.West)
     {
         return(props.angleAdjustmentWest);
     }
     else
     {
         return(props.angleAdjustmentSouth);
     }
 }
        // Token: 0x0600000E RID: 14 RVA: 0x000027F8 File Offset: 0x000009F8
        public static void get_Graphic_PostFix(Thing __instance, ref Graphic __result)
        {
            Graphic value = Traverse.Create(__instance).Field("graphicInt").GetValue <Graphic>();
            bool    flag  = value != null;

            if (flag)
            {
                ThingWithComps thingWithComps = __instance as ThingWithComps;
                bool           flag2          = thingWithComps != null;
                if (flag2)
                {
                    bool flag3 = thingWithComps.ParentHolder is Pawn;
                    if (!flag3)
                    {
                        ThingComp thingComp = thingWithComps.AllComps.FirstOrDefault((ThingComp y) => y.GetType().ToString().Contains("ActivatableEffect"));
                        bool      flag4     = thingComp != null;
                        if (flag4)
                        {
                            Pawn value2 = Traverse.Create(thingComp).Property("GetPawn", null).GetValue <Pawn>();
                            bool flag5  = value2 != null;
                            if (flag5)
                            {
                                return;
                            }
                        }
                        CompOversizedWeapon compOversizedWeapon = thingWithComps.TryGetComp <CompOversizedWeapon>();
                        bool flag6 = compOversizedWeapon != null;
                        if (flag6)
                        {
                            CompProperties_OversizedWeapon props = compOversizedWeapon.Props;
                            bool flag7 = ((props != null) ? props.groundGraphic : null) == null;
                            if (flag7)
                            {
                                value.drawSize = __instance.def.graphicData.drawSize;
                                __result       = value;
                            }
                            else
                            {
                                bool isEquipped = compOversizedWeapon.IsEquipped;
                                if (isEquipped)
                                {
                                    value.drawSize = __instance.def.graphicData.drawSize;
                                    __result       = value;
                                }
                                else
                                {
                                    CompProperties_OversizedWeapon props2 = compOversizedWeapon.Props;
                                    Graphic graphic;
                                    if (props2 == null)
                                    {
                                        graphic = null;
                                    }
                                    else
                                    {
                                        GraphicData groundGraphic = props2.groundGraphic;
                                        graphic = ((groundGraphic != null) ? groundGraphic.GraphicColoredFor(__instance) : null);
                                    }
                                    Graphic graphic2 = graphic;
                                    bool    flag8    = graphic2 != null;
                                    if (flag8)
                                    {
                                        graphic2.drawSize = compOversizedWeapon.Props.groundGraphic.drawSize;
                                        __result          = graphic2;
                                    }
                                    else
                                    {
                                        value.drawSize = __instance.def.graphicData.drawSize;
                                        __result       = value;
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }