Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?xml version="1.0" encoding="utf-8"?>
- <!DOCTYPE TranscendenceExtension
- [
- <!ENTITY unidExtension "0xEE000000">
- <!ENTITY itEMC "0xEE000001">
- <!ENTITY loaderEMC "0xEE000002">
- <!ENTITY weaponEMC "0xEE000003">
- <!ENTITY dsEMC "0xEE000004">
- <!ENTITY dsEMCMass "0xEE000006">
- <!ENTITY itLauncherEMC "0xEE000005">
- ]>
- <TranscendenceExtension
- name = "Energy-Matter converter"
- credits = "EditorRUS"
- version = "1.0"
- UNID = "&unidExtension;"
- >
- <Globals>
- (block Nil
- (setq makeEMC (lambda (EMC1)
- (block (EDens Mass Energy kdamage shockdamage shocktype shockrad shockdamage2 volume aWeapon)
- (setq Energy (objGetData EMC1 "W"))
- (setq Mass (objGetData EMC1 "kg"))
- (setq EDens (multiply (divide Energy Mass) 10000))
- (setq kdamage (divide Mass 200))
- (switch
- (geq EDens 10000000)
- (setq shocktype "singularity")
- (setq shockdamage2 "shatter3; disintegration3; deviceDisrupt5; WMD7")
- (geq EDens 1000000)
- (setq shocktype "graviton")
- (setq shockdamage2 "shatter2; deviceDisrupt4; WMD7")
- (geq EDens 500000)
- (setq shocktype "plasma")
- (setq shockdamage2 "shatter1; WMD7")
- (geq EDens 200000)
- (setq shocktype "thermo")
- (setq shockdamage2 "WMD7")
- (geq EDens 50000)
- (setq shocktype "blast")
- (setq shockdamage2 "WMD5")
- (geq EDens 10000)
- (setq shocktype "laser")
- (setq shockdamage2 "WMD3")
- (block Nil
- (setq shocktype "kinetic")
- (setq shockdamage2 "WMD1")
- )
- )
- (switch
- (eq shocktype "kinetic") ;Up to 250
- (setq shockdamage (divide (multiply 250 10000) EDens))
- (eq shocktype "laser") ;Up to 500
- (setq shockdamage (divide (multiply 500 50000) EDens))
- (eq shocktype "thermo") ;Up to 150
- (setq shockdamage (divide (multiply 150 200000) EDens))
- (eq shocktype "plasma")
- (setq shockdamage (divide (multiply 100 500000) EDens))
- (eq shocktype "graviton") ;Up to 750
- (setq shockdamage (divide (multiply 750 1000000) EDens))
- (eq shocktype "singularity") ;Up to infinity
- (setq shockdamage (divide EDens 10000000))
- )
- (setq shockrad (divide EDens (multiply 1000 shockdamage)))
- (typCreate "&weaponEMC;" (subst (objGetStaticData gSource "Weapon")
- {
- damage: (cat "kinetic:" kdamage ";" "momentum7;")
- shockwavedamage: (cat shocktype ":" "shockdamage" ";" shockdamage2)
- radius: shockrad
- }
- ))
- (setq aWeapon (itmCreate &weaponEMC; 1))
- (objSetData aWeapon "parent" EMC1)
- (objSetData EMC1 "matter" aWeapon)
- aWeapon
- )
- )
- )
- )
- </Globals>
- <ItemType UNID="&itEMC;"
- name= "EMC"
- level= "8"
- value= "75000"
- mass= "1000"
- frequency= "ultrarare"
- attributes= "MajorItem; Military; EMC"
- description= "This device gather energy in some volume and launch it"
- >
- <Image imageID="&rsItems1;" imageX="0" imageY="192" imageWidth="96" imageHeight="96"/>
- <MiscellaneousDevice
- powerUse= "0"
- external= "false"
- deviceslots= "1"
- />
- <StaticData>
- <EnergyLoad>
- <![CDATA[
- <ItemType
- name = "Energy loader"
- virtual = 1
- >
- <MiscellaneousDevice
- powerUse= "%puse%"
- external= "false"
- deviceslots= "0"
- />
- <Events>
- <OnDisable>
- (objFireEvent (objGetData gSource "parent") "PowerFailure")
- </OnDisable>
- </Events>
- </ItemType>
- ]]>
- </EnergyLoad>
- <Weapon>
- <![CDATA[
- <ItemType
- name = "EMC fire"
- virtual = 1
- >
- <Weapon
- type= "missile"
- damage= %damage%
- lifetime= "5000"
- sound= "&snRecoillessCannon;"
- >
- <Fragment
- count= "1"
- type= "area"
- damage= %shockwavedamage%
- expansionSpeed= "30"
- missileSpeed= "0"
- lifetime= %radius%
- >
- <Effect>
- <Shockwave>
- <Image imageID= "&rsShockwave1;"
- imageX= "0"
- imageY= "128"
- imageWidth= "512"
- imageHeight= "64"
- imageFrameCount= "1"
- imageTicksPerFrame= "1"/>
- </Shockwave>
- </Effect>
- </Fragment>
- </Weapon>
- </ItemType>
- ]]>
- </Weapon>
- </StaticData>
- <Invoke installedonly="true">
- (scrShowScreen gScreen "&dsEMC;")
- </Invoke>
- <Events>
- <OnUninstall>
- (if (eq (objGetData gSource "gathers") 1)
- (objFireEvent gSource "PowerFailure")
- Nil
- )
- </OnUninstall>
- <OnDisable>
- (if (eq (objGetData gSource "gathers") 1)
- (objFireEvent gSource "PowerFailure")
- Nil
- )
- </OnDisable>
- <PowerFailure> ;FUN!
- (objDamage gPlayerShip (makeEMC) "playerCreatedExplosion")
- </PowerFailure>
- <Fire>
- (block (EMC)
- (setq EMC (objGetData gSource "matter"))
- (sysCreateWeaponFire &weaponEMC; gPlayerShip (objGetPos gPlayerShip) (sysVectorAngle (objGetPos gplayership)) 30 Nil)
- (objSetData gSource "W" 0)
- (objSetData gSource "kg" 0)
- (objSetData gSource "LW" 0)
- (objSetData gSource "ready" 0)
- )
- </Fire>
- <Ready>
- (block Nil
- (objSetData gSource "ready" 1)
- (objSetData gSource "gathers" 0)
- (objRemoveItem gplayerShip (itmCreate &loaderEMC; 1) 1)
- )
- </Ready>
- </Events>
- </ItemType>
- <DockScreen UNID="&dsEMC;"
- name = "EMC controller"
- >
- <Panes>
- <Default>
- <OnPaneInit>
- <!-- (block (isGathering ready)
- (setq isGathering (objGetData gSource "gathers"))
- (setq ready (objGetData gSource "ready"))
- (scrSetDesc gScreen (subst "Welcome to the EMC control board!\nEMC %1\nEMC is %2 to fire now." (if (eq isGathering 1) "is gathering power and can't be used now" "is awaiting for orders") (if (eq ready 1) "ready" "not ready")))
- (if (eq isGathering 1)
- (block Nil
- (scrEnableAction gScreen 0 Nil)
- (scrEnableAction gScreen 1 Nil)
- (scrEnableAction gScreen 2 Nil)
- (scrEnableAction gScreen 4 Nil)
- )
- (block Nil
- (if (eq ready 0)
- (block Nil
- (scrEnableAction gScreen 0 1)
- (scrEnableAction gScreen 1 1)
- (scrEnableAction gScreen 2 1)
- (scrEnableAction gScreen 4 Nil)
- )
- (block Nil
- (scrEnableAction gScreen 0 Nil)
- (scrEnableAction gScreen 1 Nil)
- (scrEnableAction gScreen 2 Nil)
- (scrEnableAction gScreen 4 1)
- )
- )
- )
- )
- ) -->
- </OnPaneInit>
- <Actions>
- <Action name="Add a chunk of matter" key="c"> ;0
- (block Nil
- (scrShowScreen gScreen &dsEMCMass;)
- )
- </Action>
- <Action name="Set limit of energy to be collected" key="l"> ;1
- (scrShowPane gScreen "Limit")
- </Action>
- <Action name="Start to collect power" key="s"> ;2
- (block (vLoad)
- (typCreate &loaderEMC; (subst (objGetStaticData gSource "EnergyLoad")
- {
- puse: (divide (objGetMaxPower gPlayerShip) 2)
- }
- ))
- (setq vLoad (itmCreate &loaderEMC; 1))
- (objAddItem gPlayerShip vLoad)
- (shpInstallDevice gPlayerShip vLoad)
- (objSetData vLoad "parent" gSource)
- (objSetData gSource "gathers" 1)
- (scrShowPane gScreen "Default")
- )
- </Action>
- <Action name="Get information" key="g"> ;3
- (scrShowPane gScreen "Info")
- </Action>
- <Action name="Transfer charged matter in the launcher slot" key="t"> ;4
- (block (EMC)
- (setq EMC (makeEMC))
- )
- </Action>
- <Action name="Read manual" key="r"> ;5
- (scrShowPane gScreen "Manual")
- </Action>
- </Actions>
- </Default>
- <Limit showCounter="1">
- <Actions>
- <Action name="Set" key="s">
- (block (W)
- (setq W (scrGetCounter gScreen))
- (if (ls W 0)
- (scrSetCounter gScreen 0)
- (block Nil (objSetData gSource "LW" W) (scrShowPane gScreen "Default"))
- )
- )
- </Action>
- </Actions>
- </Limit>
- <Manual
- desc="The EMC is Energy-Matter-Converter. It gathers pure energy and accumulate it in some volume of matter. Be careful - EMC MUST be supplied with enough power while it gathering power. If you either disable or uninstall it when it gathers power the force field will not be able to hold the matter which fall down on the floor and explode likely destroying devices.">
- <Actions>
- <Action name="How much power the device consumes?" key="h">
- (scrShowPane gScreen "PowerConsume")
- </Action>
- <Action name="Is there a way to stop the device?" key="i">
- (scrShowPane gScreen "TheWay")
- </Action>
- <Action name="Back" key="b">
- (scrShowPane gScreen "Default")
- </Action>
- </Actions>
- </Manual>
- <PowerConsume
- desc = "It consumes half of your maximum reactor's power, no matter how much power you are using now.">
- <Actions>
- <Action name="Back" key="b">
- (scrShowPane gScreen "Manual")
- </Action>
- </Actions>
- </PowerConsume>
- <TheWay
- desc = "Virtually there's no way to do that without explosion. If you have no much power collected then you can disable device and pray the shields hold the explosion.">
- <Actions>
- <Action name="Back" key="b">
- (scrShowPane gScreen "Manual")
- </Action>
- </Actions>
- </TheWay>
- <Info>
- <OnPaneInit>
- (block (nowEnergy nowMass setLimit ETA ReactorLoad)
- (setq nowEnergy (objGetData gSource "W"))
- (setq nowMass (objGetData gSource "kg"))
- (setq setLimit (objGetData gSource "LW"))
- (setq ReactorLoad (divide (objGetMaxPower gPlayerShip) 2))
- (if (eq (objGetData gSource "gathers") 1)
- (setq ETA (divide (subtract setLimit nowEnergy) ReactorLoad))
- (setq ETA 0)
- )
- (scrSetDesc gScreen (subst "Mass: %1\nCollected power: %2\nSet limit: %3 %4" nowMass nowEnergy setLimit
- (if (eq (objGetData gSource "gathers") 1)
- (cat "\nApproximate time to finish collecting: " ETA " seconds")
- ""
- )
- ))
- )
- </OnPaneInit>
- <Actions>
- <Action name="Back" key="b">
- (block Nil
- (sysCancelTimerEvent gScreen "OnPaneInit")
- (scrShowPane gScreen "Default")
- )
- </Action>
- </Actions>
- </Info>
- </Panes>
- </DockScreen>
- <DockScreen UNID="&dsEMCMass;"
- name = "Matter chamber"
- type = "itemPicker"
- >
- <ListOptions
- dataFrom = "player"
- list = "U*; -EMC"/>
- <Panes>
- <Default desc="Choose what items you want to put inside the chamber">
- <Actions>
- <Action name="Add items in the chamber" key="a">
- (block (gItem)
- (setq gItem (scrGetItem gScreen))
- (if (eq (itmGetCount gItem) 1)
- (block Nil
- (objRemoveItem gPlayerShip gItem 1)
- (objSetData gSource "kg" (add (objGetData gSource "kg") (itmGetMass gItem)))
- )
- (scrShowPane gScreen "Quantity")
- )
- )
- </Action>
- <Action name="Back" key="b">
- (scrShowScreen gScreen &dsEMC;)
- </Action>
- </Actions>
- </Default>
- <Quantity desc="How many of that item you want to put in there?" showCounter="1">
- <Actions>
- <Action name="Add items in the chamber" default="1" key="S">
- (block (gItem)
- (setq gItem (scrGetItem gScreen))
- (objRemoveItem gPlayerShip gItem (scrGetCounter gScreen))
- (objSetData gSource "kg" (add (objGetData gSource "kg") (multiply (itmGetMass gItem) (scrGetCounter gScreen))))
- (scrShowScreen gScreen &dsEMC;)
- )
- </Action>
- <Action name="Back" key="b">
- (scrShowPane gScreen "Default")
- </Action>
- </Actions>
- </Quantity>
- </Panes>
- </DockScreen>
- <ItemType UNID="&itLauncherEMC;"
- name = "Launcher of EMC"
- level= "25"
- attributes="EMC;">
- <Events>
- <OnFireWeapon>
- (objFireEvent (objGetData gSource "parent") "Fire")
- (shpRemoveItem gPlayerShip gSource)
- (objDelete gSource)
- </OnFireWeapon>
- <OnUninstall>
- (shpRemoveItem gPlayerShip gSource)
- (objDelete gSource)
- </OnUninstall>
- <OnDisable>
- (objFireEvent (objGetData gSource "parent") "PowerFailure")
- (objDelete gSource)
- </OnDisable>
- </Events>
- </ItemType>
- </TranscendenceExtension>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement