/// <summary>Gets the fire rate for this slingshot.</summary> public int GetFireRate() { int speed; switch (SlingshotManager.GetTypeFromIndex(this.initialParentTileIndex)) { default: case SlingshotType.Basic: speed = 25; break; case SlingshotType.Master: speed = 20; break; case SlingshotType.Galaxy: speed = 15; break; } return(speed / (config.RapidFire ? 2 : 1)); }
public BetterSlingshot(IReflectionHelper reflection, BetterSlingshotsConfig config, SObject currentProjectile, bool isActionButtonDown, int which) : base(which) { this.attachments[0] = currentProjectile; this.reflection = reflection; this.config = config; this.isActionButtonDown = isActionButtonDown; this.autoFireRate = this.GetFireRate(); this.baseCanPlaySound = reflection.GetField <bool>(this, "canPlaySound"); this.isAutomatic = config.AutomaticSlingshots.IndexOf(Enum.GetName(typeof(SlingshotType), SlingshotManager.GetTypeFromIndex(this.initialParentTileIndex)), StringComparison.InvariantCultureIgnoreCase) != -1; }