Move invocation from Superconducting Coils to Shield

Post ideas & suggestions you have pertaining to the game here.
Post Reply
User avatar
Atarlost
Fleet Admiral
Fleet Admiral
Posts: 2391
Joined: Tue Aug 26, 2008 12:02 am

I've been doing this in NW Devices for years to free up the 'L' key for other invokable shields, but would like to be able to stop overriding these items. The AI currently needs the coil to have an Invoke tag, but simply removing the key prevents conflicts.

For the 1.2 beta 2 version of the superconducting shield this should work.

Code: Select all

		<Invoke key="L" installedonly="true">
			(switch
				; Does the ship have superconducting coils? If not
				; then we can't do anything.
				(not (objHasItem gSource (itmCreate &itSuperconductingCoil; 1) ) )
					(objSendMessage gSource nil "No Superconducting Coils")

				; Are the shields fully charged? If they are, then this
				; won't do anything.
				(eq (shpGetShieldDamage gSource) 0)
					(objSendMessage gSource Nil "Superconducting shields already fully charged")

				; Charge the shields
				(block Nil
					(shpRechargeShield gSource (random 40 60))
					(objRemoveItem gSource (itmCreate &itSuperconductingCoil; 1) 1)
					(objSendMessage gSource Nil "Superconducting shields recharged")
					)
				)
			)
		</Invoke>
The differences from the code in the coil are the first check is for coils rather than a shield in the first section of the switch and the removal of (itmCreate &itSuperconductingCoil; 1) instead of gItem in the last section of the switch.
Literally is the new Figuratively
Post Reply