Advertisement
Guest User

Untitled

a guest
Jul 19th, 2014
322
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.20 KB | None | 0 0
  1. <?xml version="1.0"?>
  2. <!DOCTYPE TranscendenceExtension
  3. [
  4. ;63A0-Mothership mod code request
  5. <!ENTITY unidMothershipPOC "0xE12863A0">
  6. <!ENTITY scMothership "0xE12863A1">
  7. <!ENTITY ecRUs "0xE12863A2">
  8. <!ENTITY dsMothershipManufacturing "0xE12863A3">
  9. ]>
  10. <TranscendenceExtension UNID="&unidMothershipPOC;" APIversion="22" name="Mothership POC" credit="RPC, FourFire for ideas">
  11. <!-- Player Ship: Sapphire-class Yacht -->
  12.  
  13. <ShipClass UNID="&scMothership;"
  14. manufacturer= "Zubrin Systems"
  15. class= "Mothership"
  16. type= "Proof of Concept"
  17. dockScreen= "&dsShipInterior;"
  18.  
  19. attributes= "00200000_PlayerShip"
  20. characterClass= "&unidPilgrimClass;"
  21.  
  22. mass= "30"
  23. thrustRatio= "6.6"
  24. maxSpeed= "20"
  25. cargoSpace= "50"
  26.  
  27. reactorPower= "150"
  28. fuelCapacity= "37500"
  29. maxArmor= "6000"
  30. maxCargoSpace= "150"
  31. maxDevices= "8"
  32.  
  33. leavesWreck= "30"
  34. >
  35.  
  36. <!-- Configuration -->
  37.  
  38. <Armor
  39. armorID= "&itReactiveArmor;"
  40. count= "4"
  41. />
  42.  
  43. <Devices>
  44. <DeviceSlot criteria="w" posAngle="0" posRadius="20"/>
  45.  
  46. <Device deviceID="&itRecoillessCannon;"/>
  47. <Device deviceID="&itClass1Deflector;"/>
  48. </Devices>
  49.  
  50. <Maneuver
  51. maxRotationRate= "9.0"
  52. rotationAccel= "1.5"
  53. rotationStopAccel= "9.0"
  54. />
  55.  
  56. <Items>
  57. <Item count="4d6" item="&itHelium3FuelRod;"/>
  58. </Items>
  59.  
  60. <!-- Image and Effects -->
  61.  
  62. <Image imageID="&rsSapphireYachtHD;" imageX="0" imageY="0" imageWidth="48" imageHeight="48" rotationCount="120"/>
  63.  
  64. <Effects>
  65. <Effect type="thrustMain" posAngle="160" posRadius="7" posZ="0" rotation="180" bringToFront="*"/>
  66. <Effect type="thrustMain" posAngle="-160" posRadius="7" posZ="0" rotation="180" bringToFront="*"/>
  67. <Effect type="rotateRight" posAngle="12" posRadius="20" posZ="0" rotation="90"/>
  68. <Effect type="rotateRight" posAngle="-130" posRadius="18" posZ="0" rotation="270"/>
  69. <Effect type="rotateLeft" posAngle="-12" posRadius="20" posZ="0" rotation="270"/>
  70. <Effect type="rotateLeft" posAngle="130" posRadius="18" posZ="0" rotation="90"/>
  71. </Effects>
  72.  
  73. <!-- AI and Behavior -->
  74.  
  75. <AISettings
  76. fireRateAdj= "30"
  77. fireAccuracy= "90"
  78. perception= "4"
  79. />
  80. <PlayerSettings
  81. desc= "The versatile Sapphire yacht strikes a good balance between a gunship and a freighter."
  82. largeImage= "&rsZubrinLarge;"
  83. initialClass= "true"
  84. startingCredits= "10d100+1500"
  85. >
  86.  
  87. <ArmorDisplay>
  88. <ShipImage imageID="&rsArmorHUDShip_Sapphire;" imageWidth="136" imageHeight="136"/>
  89.  
  90. <ArmorSection name="forward"
  91. segment="0"
  92. imageID="&rsZubrinArmor;"
  93. imageX="0" imageY="0" imageWidth="52" imageHeight="29"
  94. destX="42" destY="15" hpX="55" hpY="14"
  95. nameY="8" nameBreakWidth="200" nameDestX="0" nameDestY="10" />
  96.  
  97. <ArmorSection name="starboard"
  98. segment="3"
  99. imageID="&rsZubrinArmor;"
  100. imageX="52" imageY="0" imageWidth="22" imageHeight="59"
  101. destX="92" destY="45" hpX="95" hpY="60"
  102. nameY="30" nameBreakWidth="360" nameDestX="12" nameDestY="0" />
  103.  
  104. <ArmorSection name="port"
  105. segment="1"
  106. imageID="&rsZubrinArmor;"
  107. imageX="142" imageY="0" imageWidth="22" imageHeight="59"
  108. destX="22" destY="45" hpX="15" hpY="60"
  109. nameY="52" nameBreakWidth="200" nameDestX="0" nameDestY="8" />
  110.  
  111. <ArmorSection name="aft"
  112. segment="2"
  113. imageID="&rsZubrinArmor;"
  114. imageX="74" imageY="0" imageWidth="68" imageHeight="14"
  115. destX="34" destY="103" hpX="55" hpY="105"
  116. nameY="74" nameBreakWidth="360" nameDestX="12" nameDestY="0" />
  117. </ArmorDisplay>
  118.  
  119. <ShieldDisplay shieldLevelEffect="&efShieldHUDDefault;">
  120. </ShieldDisplay>
  121.  
  122. <ReactorDisplay>
  123. <Image imageID="&rsZubrinReactor;"
  124. imageX="0" imageY="0" imageWidth="256" imageHeight="60"/>
  125.  
  126. <PowerLevelImage imageID="&rsZubrinReactor;"
  127. imageX="0" imageY="60" imageWidth="202" imageHeight="14"
  128. destX="54" destY="9"/>
  129.  
  130. <FuelLevelImage imageID="&rsZubrinReactor;"
  131. imageX="0" imageY="74" imageWidth="194" imageHeight="14"
  132. destX="54" destY="37"/>
  133.  
  134. <FuelLowLevelImage imageID="&rsZubrinReactor;"
  135. imageX="0" imageY="88" imageWidth="194" imageHeight="14"/>
  136.  
  137. <ReactorText x="62" y="22" width="154" height="14"/>
  138. <PowerLevelText x="62" y="0" width="154" height="9"/>
  139. <FuelLevelText x="62" y="51" width="154" height="9"/>
  140. </ReactorDisplay>
  141.  
  142. <WeaponDisplay>
  143. <Image imageID="&rsZubrinTargeting;" imageX="0" imageY="0" imageWidth="360" imageHeight="120"/>
  144. </WeaponDisplay>
  145. </PlayerSettings>
  146. <DockingPorts>
  147. <Port x="25" y="45" />
  148. <Port x="25" y="25" />
  149. <Port x="25" y="-25" />
  150. <Port x="25" y="-45" />
  151.  
  152. <Port x="-25" y="45" />
  153. <Port x="-25" y="25" />
  154. <Port x="-25" y="-25" />
  155. <Port x="-25" y="-45" />
  156. </DockingPorts>
  157. <Events>
  158. <OnCreate>
  159. (block Nil
  160. ;trigger the scuttle events to clear the field
  161. (sysAddObjRecurringTimerEvent 450 gSource "Scuttle")
  162. (ObjSetData gSource "Scuttlersout" 0)
  163. ;init scuttle radius
  164. (ObjSetData gSource "ScuttleRadius" 150)
  165. ;(ObjSetData gSource "ScuttleRadius" 1500)
  166. )
  167. </OnCreate>
  168. <Scuttle>
  169. (block (PingsList wrecklist)
  170. ;(Plymessage gPlayer "scuttle?")
  171. ;identify wrecks in the area
  172. ;list before barricades:
  173. ;(sysFindObject gSource "N:65; Mt -b; -m;")
  174. ;the list should include the radius from mining rigs and solar collectors
  175. (setq wrecklist (filter (sysFindObject gSource (cat "N:" (ObjGetData gSource "ScuttleRadius") "; Mt -b; -m;")) wreckCandidate
  176. (block Nil
  177. (or
  178. (not (eq (ObjGetType wreckCandidate) &stBarricade1; ))
  179. )
  180. )
  181. ))
  182.  
  183. (enum
  184. wrecklist
  185. wreck (block Nil
  186. ;(Plymessage gPlayer (count (sysFindObject gSource "N:50; Mt -b; -m;")))
  187. ;(PrintTo 'log (count (sysFindObject gSource "N:50; Mt -b; -m;")))
  188. (switch
  189. (and
  190. ;object is abandoned so it's a wreck:
  191. (objisabandoned wreck)
  192. ;not already marked:
  193. (Not (eq (ObjGetData wreck "Marked_for_Scuttling") true))
  194. )
  195. (block Nil
  196. ;send a ship to scuttle the wreck (max 5 ships out scuttling, can be upgraded but will add later)
  197. (if (leq (ObjGetData gSource "ScuttlersOut") 5)
  198. (block (scuttleship)
  199. (setq Scuttleship (SysCreateShip &scEarthzone; gSource (ObjGetSovereign gPlayership)))
  200. ;register the ship
  201. (objRegisterForEvents gSource Scuttleship)
  202. (shpOrder Scuttleship 'dock wreck)
  203. ;initialize data that tells the scuttle base if the scuttler has docked with the wreck yet
  204. (ObjSetData Scuttleship "Docked_with_wreck" "False")
  205. ;in the onobjdocked, detonate the wreck
  206. ;set data on the scuttleship of the wreck target so we can check in OnObjDocked
  207. (ObjSetData ScuttleShip "wreck_target" (ObjGetID wreck))
  208. ;set home base on the scuttleship
  209. (ObjSetData ScuttleShip "home_base" (ObjGetID gSource))
  210. ;tell the ship to dock with home base in case the wreck is destroyed
  211. (shpOrder Scuttleship 'dock gSource)
  212. ;when the scuttle wreck comes back add credits
  213. (ObjIncData gSource "ScuttlersOut" 1)
  214. (ObjSetData wreck "Marked_for_Scuttling" true)
  215. )
  216. Nil
  217. )
  218. )
  219. )
  220. ;for each wreck, add scrap
  221. ;each wreck is worth the combatpower of the object in scrap
  222. ))
  223. ;this should be an upgrade though
  224. ;reduce scuttle count by one so that you don't run out of scuttlers:
  225. (ObjSetData gSource "ScuttlersOut" (subtract (ObjGetData gSource "ScuttlersOut") 1))
  226.  
  227. ;optional:
  228. ;send ships to fill docking spaces for the wreck
  229. ;more ships means that the wreck gets moved faster
  230. ;move the wreck closer to the scuttle station
  231. ;when it's on top of the graphic, scuttle the wreck
  232. ;add scrap to the player
  233. )
  234. </Scuttle>
  235. <OnObjDocked>
  236. (block Nil
  237. (switch
  238. ;if the scuttle ship docked with the target object, destroy the wreck and tell the ship to go back to home station
  239. (eq aDockTarget (ObjGetObjByID (ObjGetData aObjdocked "wreck_target")))
  240. (block Nil
  241. ;set the combatpower on the scuttle ship so you can credit the right amount of scrap when it comes back to the home station
  242. ;can't get combatpower of a wreck since it's 0
  243. (ObjSetData aObjdocked "Scrap_recovered" (objGetMass aDockTarget))
  244. ;set data so you know that the scuttle ship has docked with wreck
  245. (ObjSetData aObjdocked "Docked_with_wreck" "True")
  246. ;go back to home station
  247. (ShpOrder aObjdocked 'dock (ObjGetObjByID (ObjGetData aObjdocked "home_base")))
  248. ;destroy wreck
  249. (ObjDestroy (ObjGetObjByID (ObjGetData aObjdocked "wreck_target")) aObjdocked)
  250. )
  251. (eq aDockTarget (ObjGetObjByID (ObjGetData aObjdocked "home_base")))
  252. (block Nil
  253. ;add scrap to the player's scrap pile
  254. (plyCredit gPlayer &ecRUs; (ObjGetData aObjdocked "Scrap_recovered"))
  255. ;reduce scuttlecount by 1
  256. (ObjSetData gSource "ScuttlersOut" (subtract (ObjGetData gSource "ScuttlersOut") 1))
  257. ;get rid of the ship
  258. (ObjDestroy aObjdocked)
  259. )
  260. )
  261. )
  262. </OnObjDocked>
  263. <OnObjDestroyed>
  264. (block Nil
  265. (switch
  266. ;if the scuttle ship hasn't docked with wreck yet
  267. (eq (ObjGetData aObjDestroyed "Docked_with_wreck") "False")
  268. (block Nil
  269. ;unmark the wreck target
  270. (ObjSetData (ObjGetObjByID (ObjGetData aObjDestroyed "wreck_target")) "Marked_for_Scuttling" "False")
  271. ;decrease number of max scuttlers out
  272. (ObjSetData gSource "ScuttlersOut" (subtract (ObjGetData gSource "ScuttlersOut") 1))
  273. )
  274. )
  275. )
  276. </OnObjDestroyed>
  277. </Events>
  278. </ShipClass>
  279. <!-- Player ship's interior -->
  280.  
  281. <DockScreen UNID="&dsShipInterior;"
  282. name= "Ship's Interior"
  283. >
  284.  
  285. <Panes>
  286. <Default
  287. desc= "You are inside the main compartment of your ship. A hatch in front of you opens into the cargo hold. To the side there is a small ladder that leads to the reactor and the ship's engines.">
  288. <OnPaneInit>
  289. (block Nil
  290. (scrSetDesc gScreen (cat
  291. "The ship's computer displays vital statistics:"
  292. "\n We have " (plyGetCredits gPlayer &ecRUs;) " RUs to spare."
  293. ))
  294. )
  295. </OnPaneInit>
  296. <Actions>
  297. <Action name="Ship Configuration" key="S">
  298. (scrShowScreen gScreen &dsShipConfig;)
  299. </Action>
  300.  
  301. <Action name="View Ship's Construction" key="V" >
  302. (block Nil
  303. (setq gDest Nil)
  304. (scrShowScreen gScreen &dsCargoHold;)
  305. )
  306. </Action>
  307.  
  308. <Action name="Refuel Reactor" key="R" >
  309. (scrShowScreen gScreen &dsManualRefuel;)
  310. </Action>
  311.  
  312. <Action name="Back to Cockpit" cancel="1" key="B">
  313. (scrExitScreen gScreen)
  314. </Action>
  315. </Actions>
  316. </Default>
  317. </Panes>
  318. </DockScreen>
  319. <DockScreen UNID="&dsMothershipManufacturing;"
  320. name= "Ship's Interior"
  321. nestedScreen= "true"
  322. >
  323.  
  324. <Panes>
  325. <Default
  326. desc= "You are inside the main compartment of your ship. A hatch in front of you opens into the cargo hold. To the side there is a small ladder that leads to the reactor and the ship's engines.">
  327. <OnPaneInit>
  328. (block Nil
  329. (scrSetDesc gScreen (cat
  330. "The ship's computer displays vital statistics:"
  331. "\n We have " (plyGetCredits gPlayer &ecRUs;) " RUs to spare."
  332. ))
  333. )
  334. </OnPaneInit>
  335. <Actions>
  336. <Action name="Recycle Items" key="S">
  337. (scrSetDesc gScreen (cat
  338. "This currently does nothing"
  339. ))
  340. </Action>
  341. <Action name="Manufacture Items" key="S">
  342. (scrSetDesc gScreen (cat
  343. "This currently does nothing"
  344. ))
  345. </Action>
  346.  
  347. <Action name="Leave Manufacturing" cancel="1" key="L">
  348. (scrExitScreen gScreen)
  349. </Action>
  350. </Actions>
  351. </Default>
  352. </Panes>
  353. </DockScreen>
  354. <EconomyType UNID="&ecRUs;"
  355. id= "RU"
  356. currency= "RU|RUs"
  357. conversion= "10"
  358. />
  359. </TranscendenceExtension>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement