internal static void SkillGunAttackTwoShot_execute_Postfix(ref SkillGunAttackTwoShot __instance, State __state, SkillGunAttackTwoShot ___m_skillGunOtherHand) { if (Main.configEnabled.Value) { if (__state.isDoubleShot && __instance.iCount == 2 || __instance.iCount == 0) { __instance.character.m_charInventory.Insert(MiCharacterInventory.ItemType.GunAmmo, (uint)Main.configAmmo.Value, true, true); } __instance.m_skillRangedData.m_fCooldown = __state.originalCooldown; ___m_skillGunOtherHand.m_skillRangedData.m_fCooldown = __state.originalCooldown; } }
internal static void SkillGunAttackTwoShot_execute_Prefix(ref SkillGunAttackTwoShot __instance, ref State __state, bool ___m_bTryExecuteTwoShot, PlanningModeCommand ___m_commandSecond, SkillGunAttackTwoShot ___m_skillGunOtherHand) { if (Main.configEnabled.Value) { __state = new State { originalCooldown = __instance.m_skillRangedData.m_fCooldown, isDoubleShot = ___m_bTryExecuteTwoShot && !___m_commandSecond.bExecute && ___m_commandSecond.skill.bIsInRange(___m_commandSecond.skillCommand) && SkillThrow.bValidRaycast(__instance.character, __instance, ___m_commandSecond.skillCommand.m_MiCharacterTarget, true, null), }; var needReload = __state.isDoubleShot ? __instance.iCount == 2 : __instance.iCount == 1; var cooldown = needReload ? Main.configCooldownReload.Value : Main.configCooldownShot.Value; __instance.m_skillRangedData.m_fCooldown = cooldown; ___m_skillGunOtherHand.m_skillRangedData.m_fCooldown = cooldown; if (!__state.isDoubleShot) { ___m_skillGunOtherHand.startCooldown(cooldown); } } }