public void Awake() { if (!RoR2Application.isModded) { RoR2Application.isModded = true; } #region ConfigSetup const string falloffDistanceSection = "Falloff Distance"; const string presetSection = "Presets"; var buttonUtil = new ButtonUtil(this.Config); buttonUtil.AddButtonConfig(presetSection, "Buttons", "", GetButtonDic()); FallOffStartDistance = Config.Bind <float>( new ConfigDefinition(falloffDistanceSection, nameof(FallOffStartDistance)), 40f, new ConfigDescription( "Set the distance at which damage starts to fall off (default=25, recommended=40)" ) ); FallOffEndDistance = Config.Bind <float>( new ConfigDefinition(falloffDistanceSection, nameof(FallOffEndDistance)), 80f, new ConfigDescription( "Set the distance at which damage reaches minimum (default=60, recommended=80)" ) ); #endregion IL.RoR2.BulletAttack.DefaultHitCallback += BulletAttack_DefaultHitCallback; }
public void Awake() { if (!RoR2Application.isModded) { RoR2Application.isModded = true; } #region ConfigSetup const string fireSonicBoomSection = "FireSonicBoom"; const string boopModifierSection = "Boop Modifiers"; var buttonUtil = new ButtonUtil(this.Config); buttonUtil.AddButtonConfig("Presets", "Preset", "Select preset configurations with buttons", GetButtonDictionary()); ClayBruiserIsMighty = Config.Bind <bool>( new ConfigDefinition(boopModifierSection, nameof(ClayBruiserIsMighty)), false, new ConfigDescription( "Set whether the boop of the Clay Templar is mighty like Rex" )); RandomDirection = Config.Bind <bool>( new ConfigDefinition(boopModifierSection, "RandomHorizontalForce"), false, new ConfigDescription( "When enabled the HorizontalForce becomes a random number between the +/- value (e.g. if force = 500, when random the force becomes any number between -500 to 500)" )); AirKnockBackDistance = Config.Bind <float>( new ConfigDefinition(fireSonicBoomSection, nameof(AirKnockBackDistance)), BoopConstants.AirKnockBackDistanceRecommended, new ConfigDescription( "Set how far you knock yourself back when you boop in mid-air." + $"(Game default = {BoopConstants.AirKnockBackDistanceDefault}, Recommended = {BoopConstants.AirKnockBackDistanceRecommended})", new AcceptableValueRange <float>(0, 1000), ConfigTags.Advanced )); GroundKnockBackDistance = Config.Bind <float>( new ConfigDefinition(fireSonicBoomSection, nameof(GroundKnockBackDistance)), BoopConstants.GroundKnockBackDistanceRecommended, new ConfigDescription( "Set how far you knock yourself back when you boop whilst on the ground." + $"(Game default = {BoopConstants.GroundKnockBackDistanceDefault}, Recommended = {BoopConstants.GroundKnockBackDistanceRecommended})", new AcceptableValueRange <float>(0, 1000), ConfigTags.Advanced )); IdealDistanceToPlaceTargets = Config.Bind <float>( new ConfigDefinition(fireSonicBoomSection, "HorizontalForce"), BoopConstants.IdealDistanceDefault, new ConfigDescription( "Set the horizontal distance which enemies should be knocked back by the boop (can be set -ve for opposite effect)" + $"(Game default = {BoopConstants.MaxDistanceDefault}, Recommended = {BoopConstants.MaxDistanceRecommended})", new AcceptableValueRange <float>(-1000, 1000), ConfigTags.Advanced )); MaxDistance = Config.Bind <float>( new ConfigDefinition(fireSonicBoomSection, "BoopRange"), BoopConstants.MaxDistanceRecommended, new ConfigDescription( "Range at which enemies will be effected by boop" + $"(Game default = {BoopConstants.MaxDistanceDefault}, Recommended = {BoopConstants.MaxDistanceRecommended})", new AcceptableValueRange <float>(0, 500), ConfigTags.Advanced )); LiftVelocity = Config.Bind <float>( new ConfigDefinition(fireSonicBoomSection, nameof(LiftVelocity)), BoopConstants.LiftVelocityRecommended, new ConfigDescription( "Set the vertical lift of enemies affected by the boop. " + $"(Game default = {BoopConstants.LiftVelocityDefault}, Recommended = {BoopConstants.LiftVelocityRecommended})", new AcceptableValueRange <float>(0, 100), ConfigTags.Advanced )); #endregion On.EntityStates.Treebot.Weapon.FireSonicBoom.OnEnter += FireSonicBoom_OnEnter; On.EntityStates.ClayBruiser.Weapon.FireSonicBoom.OnEnter += ClayBruiserFireSonicBoom_OnEnter; }