Function; AddShipMultiplier - HWRM/KarosGraveyard GitHub Wiki

AddShipMultiplier(<rShip>, <sMultiplierType>, <sTarget>, <sScaleType>, <fMinMultiplier>, <fMaxMultiplier>, <fRadius>)
AddSubSystemMultiplier(<rSubSystem>, <sMultiplierType>, <sTarget>, <sScaleType>, <fMinMultiplier>, <fMaxMultiplier>, <fRadius>)

Description

These functions give a ship or subsystem the ability to increase or decrease the specified statistic of itself, or of all friendly ships including itself, other friendly ships excluding itself, or all enemies within the specified radius. The amount of increase or decrease depends on the specified multiplier, and the multiplier can vary depending on the current health of the ship or subsystem providing the multiplier.

AddShipMultiplier is called within a .ship file, while AddSubSystemMultiplier is called within a .subs file.

Example

AddShipMultiplier(NewShipType, "WeaponAccuracy", "OwnShipsWithinRadiusExcludingThisShip", "Linear", 1.15, 1.15, 4500)
AddSubSystemMultiplier(NewSubSystemType, "BuildSpeed", "ThisShipOnly", "Linear", 1.3, 1, 0)

Arguments

<rShip> and <rSubSystem>: Reference to the ship or subsystem. Generally, this will be NewShipType or NewSubSystemType, respectively.
<sMultiplierType>: Specifies the statistic to be affected by the multiplier. See Modifiable Values.
<sTarget>: Specifies which ships within the fRadius receive the specified multiplier. Possible values are EnemyShipsWithinRadius, OwnShipsWithinRadius, OwnShipsWithinRadiusExcludingThisShip, and ThisShipOnly.
<sScaleType>: Possible values are Linear and None. If set to Linear, the actual multiplier applied depends on the current health of the ship or subsystem providing the multiplier. If the ship or subsystem has 0 health, the fMinMultiplier is used. With any health greater than 0, the multiplier is scaled in a linear fashion up to the value of fMaxMultiplier if the ship or subsystem has full health. If set to None, the fMaxMultiplier value is always used for all affected ships.
<fMinMultiplier>: The minimum possible multiplier if sScaleType is set to Linear and the ship or subsystem providing the multiplier has 0 health.
<fMaxMultiplier>: The maximum possible multiplier if sScaleType is set to Linear and the ship or subsystem providing the multiplier has full health, or the multiplier if sScaleType is set to None.
<fRadius>: The radius within which any ship allowed by the sTarget setting is affected by the specified multiplier type.

Related Pages

Function Reference

Modifiable Values

Comments

Thanks, Nickerson, for inputting the basic info.
Reformated the entire page.
Clarified and corrected descriptions.
Fixed (many) typos.
Added AddSubSystemMultiplier function.

--RangerHW (2003-10-10 16:15:52)

Made it even more pretty. :)

--Thought (2003-10-10 19:04:55)

Cleaned up page slightly to make more standardized with other pages.

--RangerHW (2003-10-13 11:43:15)

Modified the order of arguments between min and max values; max comes first.

--SunTzu (2006-03-11 15:13:29)

forget about that, I got confused :(

--SunTzu (2006-03-12 06:18:26)

Page Status

Updated Formatting? Initial
Updated for HWRM? Initial

⚠️ **GitHub.com Fallback** ⚠️