Пример #1
0
        private void iconClickAction(int buttonID)
        {
            if (interactedWeapon != null)
            {
                Thing toSwapTo;
                if (interactedRanged)
                {
                    if (buttonID == 0)
                    {
                        toSwapTo = interactedWeapon;

                        if (GoldfishModule.GetGoldfishForPawn(parent) != null && toSwapTo.def.defName.Equals(GoldfishModule.GetGoldfishForPawn(parent).primary))
                        {
                            PlayerKnowledgeDatabase.KnowledgeDemonstrated(SidearmsDefOf.Concept_SidearmsPrimary, KnowledgeAmount.Total);
                        }

                        WeaponAssingment.weaponSwapSpecific(parent, toSwapTo, true, MiscUtils.shouldDrop(DroppingModeEnum.UserForced), false);
                        SwapControlsHandler handler = SwapControlsHandler.GetHandlerForPawn(parent);
                        if (handler.autoLockOnManualSwap)
                        {
                            handler.currentWeaponLocked = true;
                        }

                        PlayerKnowledgeDatabase.KnowledgeDemonstrated(SidearmsDefOf.Concept_SidearmsInInventory, KnowledgeAmount.SpecificInteraction);
                        PlayerKnowledgeDatabase.KnowledgeDemonstrated(SidearmsDefOf.Concept_SimpleSidearmsBasic, KnowledgeAmount.SmallInteraction);
                    }
                    else if (buttonID == 1)
                    {
                        WeaponAssingment.dropSidearm(parent, interactedWeapon);

                        PlayerKnowledgeDatabase.KnowledgeDemonstrated(SidearmsDefOf.Concept_SidearmsInInventory, KnowledgeAmount.SpecificInteraction);
                        PlayerKnowledgeDatabase.KnowledgeDemonstrated(SidearmsDefOf.Concept_SimpleSidearmsBasic, KnowledgeAmount.SmallInteraction);
                    }
                }
                else
                {
                    if (buttonID == 0)
                    {
                        toSwapTo = interactedWeapon;

                        if (GoldfishModule.GetGoldfishForPawn(parent) != null && toSwapTo.def.defName.Equals(GoldfishModule.GetGoldfishForPawn(parent).primary))
                        {
                            PlayerKnowledgeDatabase.KnowledgeDemonstrated(SidearmsDefOf.Concept_SidearmsPrimary, KnowledgeAmount.Total);
                        }

                        WeaponAssingment.weaponSwapSpecific(parent, toSwapTo, true, MiscUtils.shouldDrop(DroppingModeEnum.UserForced), false);

                        PlayerKnowledgeDatabase.KnowledgeDemonstrated(SidearmsDefOf.Concept_SidearmsInInventory, KnowledgeAmount.SpecificInteraction);
                        PlayerKnowledgeDatabase.KnowledgeDemonstrated(SidearmsDefOf.Concept_SimpleSidearmsBasic, KnowledgeAmount.SmallInteraction);
                    }
                    else if (buttonID == 1)
                    {
                        WeaponAssingment.dropSidearm(parent, interactedWeapon);

                        PlayerKnowledgeDatabase.KnowledgeDemonstrated(SidearmsDefOf.Concept_SidearmsInInventory, KnowledgeAmount.SpecificInteraction);
                        PlayerKnowledgeDatabase.KnowledgeDemonstrated(SidearmsDefOf.Concept_SimpleSidearmsBasic, KnowledgeAmount.SmallInteraction);
                    }
                }
            }
            else if (interactedWeaponMemory != null)
            {
                if (interactedRanged)
                {
                    if (buttonID == 0)
                    {
                    }
                    else if (buttonID == 1)
                    {
                        WeaponAssingment.forgetSidearmMemory(parent, interactedWeaponMemory);

                        PlayerKnowledgeDatabase.KnowledgeDemonstrated(SidearmsDefOf.Concept_SidearmsMissing, KnowledgeAmount.SpecificInteraction);
                        PlayerKnowledgeDatabase.KnowledgeDemonstrated(SidearmsDefOf.Concept_SimpleSidearmsBasic, KnowledgeAmount.SmallInteraction);
                    }
                }
                else
                {
                    if (buttonID == 0)
                    {
                    }
                    else if (buttonID == 1)
                    {
                        WeaponAssingment.forgetSidearmMemory(parent, interactedWeaponMemory);

                        PlayerKnowledgeDatabase.KnowledgeDemonstrated(SidearmsDefOf.Concept_SidearmsMissing, KnowledgeAmount.SpecificInteraction);
                        PlayerKnowledgeDatabase.KnowledgeDemonstrated(SidearmsDefOf.Concept_SimpleSidearmsBasic, KnowledgeAmount.SmallInteraction);
                    }
                }
            }
            else if (interactedUnarmed == true)
            {
                if (buttonID == 0)
                {
                    WeaponAssingment.weaponSwapSpecific(parent, null, true, MiscUtils.shouldDrop(DroppingModeEnum.UserForced), false);
                    PlayerKnowledgeDatabase.KnowledgeDemonstrated(SidearmsDefOf.Concept_SimpleSidearmsBasic, KnowledgeAmount.SmallInteraction);
                }
            }
        }
Пример #2
0
 private void iconClickAction(int buttonID)
 {
     if (interactedWeapon != null)
     {
         Thing toSwapTo;
         if (interactedRanged)
         {
             if (buttonID == 0)
             {
                 toSwapTo = interactedWeapon;
                 WeaponAssingment.weaponSwapSpecific(parent, toSwapTo, true, MiscUtils.shouldDrop(DroppingModeEnum.UserForced), false);
                 SwapControlsHandler handler = SwapControlsHandler.GetHandlerForPawn(parent);
                 if (handler.autoLockOnManualSwap)
                 {
                     handler.currentWeaponLocked = true;
                 }
             }
             else if (buttonID == 1)
             {
                 WeaponAssingment.dropSidearm(parent, interactedWeapon);
             }
         }
         else
         {
             if (buttonID == 0)
             {
                 toSwapTo = interactedWeapon;
                 WeaponAssingment.weaponSwapSpecific(parent, toSwapTo, true, MiscUtils.shouldDrop(DroppingModeEnum.UserForced), false);
             }
             else if (buttonID == 1)
             {
                 WeaponAssingment.dropSidearm(parent, interactedWeapon);
             }
         }
     }
     else if (interactedWeaponMemory != null)
     {
         if (interactedRanged)
         {
             if (buttonID == 0)
             {
             }
             else if (buttonID == 1)
             {
                 WeaponAssingment.forgetSidearmMemory(parent, interactedWeaponMemory);
             }
         }
         else
         {
             if (buttonID == 0)
             {
             }
             else if (buttonID == 1)
             {
                 WeaponAssingment.forgetSidearmMemory(parent, interactedWeaponMemory);
             }
         }
     }
     else if (interactedUnarmed == true)
     {
         if (buttonID == 0)
         {
             WeaponAssingment.weaponSwapSpecific(parent, null, true, MiscUtils.shouldDrop(DroppingModeEnum.UserForced), false);
         }
     }
 }