Skip to content

Upgrades

Michael Speth edited this page Oct 18, 2017 · 1 revision

(For version 0.1.2)

New upgrade is created as child of class "Upgrade.GenericUpgrade" or as child of "Upgrade.GenericSecondaryWeapon"

For squad builder only constructor of upgrade is called.

In "Upgrade.GenericUpgrade" class following fields must be set:

  • Type as UpgradeType
  • Name
  • ShortName (used in info panel with ship's status)
  • ImageUrl (link to card image, used for tooltip, use images from X-Wing Data)
  • flag "isUnique" (by default false)

Method "AttachToShip" is called when upgrade is installed in ship during battle initialization.

  • Call base method (it sets Host for upgrade)
  • Here all "subscibe to event" should be created.

In "Upgrade.GenericSecondaryWeapon" class following fields must be set:

  • MinRange
  • MaxRange
  • AttackValue
  • CanShootOutsideArc (for turrets, by default false)
  • IsDiscardedForShot (for torpedoes/missiles, upgrade will be discarded after shot, by default false)
  • RequiresFocusToShoot
  • RequiresTargetLockOnTargetToShoot
  • SpendsTargetLockOnTargetToShoot (for torpedoes/missiles, target lock on target will be spent as attack cost, by default false)
  • IsTwinAttack (attack will be performed twice, by default false)

Method "IsShotAvailable" is called to check if ship can attack target with this weapon, has default implementation.

Method "PayAttackCost" is called to pay attack cost (discard, spend Target Lock)