Created
July 24, 2010 05:24
-
-
Save alterecco/488432 to your computer and use it in GitHub Desktop.
tscript debugShip
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(setq debugShip (lambda (shp) | |
(block (devCnt tItem) | |
(dbgLog "####################################################") | |
(dbgLog " ") | |
(dbgLog " ------ (shpGetDataField) -----") | |
(dbgLog "| Name | " (shpGetDataField shp "name") " |") | |
(dbgLog "| Manufacturer | " (shpGetDataField shp "manufacturer") " |") | |
(dbgLog "| Level | " (shpGetDataField shp "level") " |") | |
(dbgLog "| Score | " (shpGetDataField shp "score") " |") | |
(dbgLog "| Max Speed | " (shpGetDataField shp "maxSpeed") " |") | |
(dbgLog "| Maneuver | " (shpGetDataField shp "maneuver") " |") | |
(dbgLog "| Thrust To Weight | " (shpGetDataField shp "thrustToWeight") " |") | |
(dbgLog "| Cargo Space | " (shpGetDataField shp "cargoSpace") " |") | |
(dbgLog "| Fire Accuracy | " (shpGetDataField shp "fireAccuracy") " |") | |
(dbgLog "| Fire Range Adj | " (shpGetDataField shp "fireRangeAdj") " |") | |
(dbgLog "| Fire Rate Adj | " (shpGetDataField shp "fireRateAdj") " |") | |
(dbgLog "| Explosion | " (shpGetDataField shp "explosion") " |") | |
(dbgLog "| Primary Armor | " (shpGetDataField shp "primaryArmor") " |") | |
(dbgLog "| Primary Armor UNID | " (shpGetDataField shp "primaryArmorUNID") " |") | |
(dbgLog "| Primary Weapon | " (shpGetDataField shp "primaryWeapon") " |") | |
(dbgLog "| Primary Weapon UNID | " (shpGetDataField shp "primaryWeaponUNID") " |") | |
(dbgLog "| Primary Weapon Range | " (shpGetDataField shp "primaryWeaponRange") " |") | |
(dbgLog "| Primary Weapon Range Adj | " (shpGetDataField shp "primaryWeaponRangeAdj") " |") | |
(dbgLog "| Launcher | " (shpGetDataField shp "launcher") " |") | |
(dbgLog "| Launcher UNID | " (shpGetDataField shp "launcherUNID") " |") | |
(dbgLog "| Shield | " (shpGetDataField shp "shield") " |") | |
(dbgLog "| Shield UNID | " (shpGetDataField shp "shieldsUNID") " |") | |
(dbgLog " ") | |
(dbgLog " ------ (built-in shp functions) -----") | |
(dbgLog "| Class | " (shpGetClass shp) " |") | |
(dbgLog "| Class Name | " (shpGetClassName (shpGetClass shp) 0) " |") | |
(dbgLog "| Max Speed | " (shpGetMaxSpeed shp) " |") | |
(dbgLog "| Shield | " (itmGetName (itmCreate (shpGetShieldItemUNID shp) 1) 0) " |") | |
(dbgLog "| Shield UNID | " (shpGetShieldItemUNID shp) " |") | |
(dbgLog "| Shield Max HP | " (shpGetShieldMaxHitPoints shp) " |") | |
(dbgLog "| Autopilot | " (shpIsAutopilotInstalled shp) " |") | |
(dbgLog "| Radiation Immune | " (shpIsRadiationImmune shp) " |") | |
(dbgLog "| SRS | " (shpIsSRSEnhanced shp) " |") | |
(dbgLog "| Targeting Computer | " (shpIsTargetingComputerInstalled shp) " |") | |
(dbgLog " ") | |
(dbgLog " ------ (built-in obj functions) -----") | |
(dbgLog "| Can Attack | " (objCanAttack shp) " |") | |
(dbgLog "| Balance | " (objGetBalance shp) " |") | |
(dbgLog "| Cargo Space Left | " (objGetCargoSpaceLeft shp) " |") | |
(dbgLog "| Combat Power | " (objGetCombatPower shp) " |") | |
(dbgLog "| Damage Type | " (objGetDamageType shp) " |") | |
(dbgLog "| Level | " (objGetLevel shp) " |") | |
(dbgLog "| Mass | " (objGetMass shp) " |") | |
(dbgLog "| Max Power | " (objGetMaxPower shp) " |") | |
(dbgLog "| Name | " (objGetName shp 0) " |") | |
(dbgLog " ") | |
(dbgLog " ------ (installed items) -----") | |
(objEnumItems shp "*I" itm | |
(block Nil | |
(dbgLog "| Item Name | " (itmGetName itm 0) " |") | |
(switch | |
(eq (itmGetCategory itm) 0x2) | |
(block Nil | |
(dbgLog "| Item Category | " "Armor" " |") | |
(dbgLog "| Armor HP | " (armGetHitPoints (itmGetArmorType itm)) " |") | |
(dbgLog "| Armor Repair Tech | " (armGetRepairTech (itmGetArmorType itm)) " |") | |
(dbgLog "| Armor Repair Cost | " (armGetRepairCost (itmGetArmorType itm)) " |") | |
(dbgLog "| Armor Install Location | " (objGetArmorName shp (itmGetArmorInstalledLocation itm)) " |") | |
) | |
(eq (itmGetCategory itm) 0x10) | |
(block Nil | |
(dbgLog "| Item Category | " "Launcher" " |") | |
(dbgLog "| Launcher Damage Type | " (itmGetDamageType itm) " |") | |
) | |
(eq (itmGetCategory itm) 0x4) | |
(block Nil | |
(dbgLog "| Item Category | " "Weapon" " |") | |
(dbgLog "| Weapon Damage Type | " (itmGetDamageType itm) " |") | |
) | |
(eq (itmGetCategory itm) 0x80) | |
(dbgLog "| Item Category | " "Shield" " |") | |
(eq (itmGetCategory itm) 0x40) | |
(dbgLog "| Item Category | " "Reactor" " |") | |
(eq (itmGetCategory itm) 0x800) | |
(dbgLog "| Item Category | " "Drive" " |") | |
(eq (itmGetCategory itm) 0x1) | |
(dbgLog "| Item Category | " "Miscellaneous" " |") | |
(eq (itmGetCategory itm) 0x1000) | |
(dbgLog "| Item Category | " "Useable" " |") | |
) | |
(dbgLog "| Item Price | " (itmGetPrice itm) " |") | |
(dbgLog "| Item Mass | " (itmGetMass itm) " |") | |
(dbgLog "| Item Level | " (itmGetLevel itm) " |") | |
(dbgLog "| Item Frequency | " (itmGetFrequency itm) " |") | |
(dbgLog "| Item UNID | " (itmGetUNID itm) " |") | |
(dbgLog "| Item Enhanced | " (itmIsEnhanced itm) " |") | |
(dbgLog " -----") | |
;; remove the item so we can test how many we can install | |
(objRemoveItem shp itm) | |
) | |
) | |
(dbgLog " ") | |
(dbgLog " ------ (misc info) -----") | |
;; weapons | |
(setq devCnt 0) | |
(setq tItem (itmCreate &itLaserCannon; 1)) | |
;; loop while we can still install the weapon | |
(loop (eq (shpCanInstallDevice shp tItem) 0) (block Nil | |
(objAddItem shp tItem) | |
(shpInstallDevice shp tItem) | |
(setq devCnt (add devCnt 1)) | |
)) | |
(dbgLog "| Weapon Slots | " devCnt " |") | |
;; reset the ship and count | |
(objEnumItems shp "*I" itm | |
(shpRemoveDevice shp itm) | |
) | |
(setq devCnt 0) | |
; devices | |
(setq tItem (itmCreate &itSolarPanelArray; 1)) | |
;; loop while we can still install the device | |
(loop (eq (shpCanInstallDevice shp tItem) 0) (block Nil | |
(objAddItem shp tItem) | |
(shpInstallDevice shp tItem) | |
(setq devCnt (add devCnt 1)) | |
)) | |
(dbgLog "| Device Slots | " devCnt " |") | |
(dbgLog "####################################################") | |
) | |
)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment