I've been lurking around for a bit, and have played around with this mod. I have to say, I rather like it.
Though, I found a couple little problems, just as a way to familiarize myself more with the XML format, and what not.
Normally after a repair attempt you are ejected from the repair screen. This got quite tedious, so I fixed that. Now it should cycle back to the repair selection after a failure.
Next, I saw that you seemed simply unable to level, at least at any reasonable rate. After a bit of pondering, I've thought of the following leveling scheme:
Skill mod = Wrench Skill / 10 / (Shield [2] or Reactor [3])
-In order to repair with the least amount of risk, you must have a skill mod equal to the item's level.
-If the repair is a success, gain +1 to wrench skill.
Example:
In order to repair a level 2 shield with little risk you would need a wrench skill of 40. ( 40 Wrench skill / 10 / 2 Shield = 2 )
I'm interested if any of these changes might be useful to you. ^^
Code: Select all
<?xml version="1.0" ?>
<!DOCTYPE TranscendenceExtension
[
<!ENTITY unidWrenchMod "0xD4660001">
<!ENTITY rsWrench "0xD466F002">
<!ENTITY dsUseWrench "0xD466A001">
<!ENTITY itAlmightyWrench "0xD4664011">
]>
<TranscendenceExtension UNID="&unidWrenchMod;" version="0.98">
<!--
MODIFICATION BY THE WICKED FLEA
Version 1.0
Image is a standard wrench in the public domain. ;-)
-->
<Image UNID="&rsWrench;" bitmap="wrench.jpg" bitmask="wrenchMask.bmp"/>
<!-- The dockscreen for our specialty wrench: -->
<DockScreen UNID="&dsUseWrench;"
name= "Ship's Cargo Hold"
type= "itemPicker"
backgroundID= "&rsItemListScreen;"
>
<ListOptions
dataFrom= "player"
list= "wvsrlD"
/>
<Panes>
<Default
desc= "What item do you wish to repair?">
<Initialize>
(block (theOdds)
(setq gItem (scrGetItem gScreen))
(if gItem
(block Nil
(setq thisItem (itmGetUNID gItem))
(setq itemName (itmGetName gItem 32))
(setq wrenchSkill (objGetGlobalData gPlayerShip "WrenchSkill"))
(if (or (leq wrenchSkill 0) (not wrenchSkill))
(block Nil
(objSetGlobalData gPlayerShip "WrenchSkill" 1)
(setq wrenchSkill 1)
)
)
(setq wrenchGoBetween ( divide wrenchSkill 10 ))
(setq skillMod (subtract wrenchGoBetween (itmGetLevel gItem)))
(switch
(itmMatches gItem "s") ; Shields are just harder in the first place
(setq skillMod (divide skillMod 2))
(itmMatches gItem "r") ; Reactors are nearly lethal
(setq skillMod (divide skillMod 3))
)
(if (geq skillMod 0)
(setq gDesc (cat "The \"" itemName "\" can be repaired with almost no risk. \"" WrenchSkill "\" is Current Skill level. "))
(setq gDesc (cat "Repairing the \"" itemName "\" could be risky. \"" WrenchSkill "\" is Current Skill level. Do you wish to attempt a repair?"))
)
(scrSetDesc gScreen gDesc)
)
(scrSetDesc gScreen "There are no items to repair.")
)
(scrEnableAction gScreen 0 gItem)
)
</Initialize>
<Actions>
<Action name="Repair this item" imageID="&rsItemListScreen;" imageIndex="1" default="1" key="R">
(block (cursor failure criticalFail criticalDeath)
(setq cursor (scrGetItemListCursor gScreen))
(setq dRoll (rollDice 3 6 0))
(setq failure (ls (add 8 skillMod) dRoll))
(setq criticalFail (leq (add dRoll skillMod) 4)) ; Risk does make a critical failure easier...
(switch
(itmMatches gItem "w")
(setq criticalDeath (and criticalFail (leq (rollDice 2 6 0) 4)) )
(itmMatches gItem "l")
(setq criticalDeath (and criticalFail (leq (rollDice 2 6 0) 5)) )
(itmMatches gItem "r")
(setq criticalDeath (and criticalFail (leq (rollDice 2 6 0) 10)) )
(block Nil
(setq criticalDeath (and criticalFail (eq (rollDice 2 6 0) 2)) )
)
)
(if (not (or failure criticalFail criticalDeath)) ; If we haven't failed or died then assume that it has been repaired.
(block Nil
(setq gTitle (cat "After banging around on the " itemName " you manage to successfully repair it."))
(objSetGlobalData gPlayerShip "WrenchSkill" (add wrenchSkill 1))
(shpRepairItem gPlayerShip cursor)
(scrShowPane gScreen "Used")
)
(switch
failure
(block Nil
(setq gTitle (cat "After banging around on the " itemName " for awhile you give up. The effort was completely fruitless."))
(scrShowPane gScreen "Failed")
)
criticalFail
(block Nil
(if (itmIsInstalled gItem)
(shpRemoveDevice gPlayerShip gItem)
)
(objRemoveItem gPlayerShip gItem 1)
(setq gTitle (cat "With stunning ease you bash the " itemName " and the device shatters."))
(scrShowPane gScreen "Broke")
)
criticalDeath
(block Nil
(switch
(or (itmMatches gItem "w") (itmMatches gItem "l"))
(block Nil
(setq gTitle "Smooth move, \"Einstein\", you managed to blow yourself to smitherines with the very weapon you were attempting to repair.")
(setq gDeath "vaporized by a damaged ship-class weapon")
)
(itmMatches gItem "s")
(block Nil
(setq gTitle "In a very complex maneuver you touch a wrong wire and the shield generator turns you into a wisp of ash.")
(setq gDeath "incinerated by a damaged shield generator")
)
(itmMatches gItem "v")
(block Nil
(setq gTitle "You managed to fix the drive but it was still connected to the generator, and you left the blast shields open.")
(setq gDeath "died of third degree burns caused by a damaged stardrive")
)
(itmMatches gItem "r")
(block Nil
(setq gTitle "You accidentally put on a biohazard suit instead of your radiation suit while trying to fix the reactor. Needless to say you liquified rather quickly.")
(setq gDeath "melted by a reactor")
)
(block Nil
(setq gTitle (cat "Somewhere you feel like someone has been mocking you. Somehow while repairing the " itemName " you managed to kill yourself."))
(setq gDeath (cat "killed by attempting to repair the " itemName))
)
)
(scrShowPane gScreen "KilledByStupidity")
)
)
)
)
</Action>
<Action name="Cancel" imageID="&rsItemListScreen;" imageIndex="0" cancel="1" key="C">
<Exit/>
</Action>
</Actions>
</Default>
<KilledByStupidity
desc="=gTitle"
noListNavigation="true"
>
<Initialize>
(plyDestroyed gPlayer gDeath)
</Initialize>
<Actions>
<Action name="Exit" imageID="&rsItemListScreen;" imageIndex="0" default="1" cancel="1" key="X">
<Exit/>
</Action>
</Actions>
</KilledByStupidity>
<Failed
desc="=gTitle"
noListNavigation="true"
>
<Actions>
<Action name="Continue" imageID="&rsItemListScreen;" imageIndex="0" default="1" cancel="1" key="C">
(scrShowPane gScreen "Default")
</Action>
</Actions>
</Failed>
<Broke
desc="=gTitle"
noListNavigation="true"
>
<Actions>
<Action name="Continue" imageID="&rsItemListScreen;" imageIndex="0" default="1" cancel="1" key="C">
<Exit/>
</Action>
</Actions>
</Broke>
<Used
desc="=gTitle"
noListNavigation="true"
>
<Actions>
<Action name="Continue" imageID="&rsItemListScreen;" imageIndex="0" default="1" cancel="1" key="C">
<Exit/>
</Action>
</Actions>
</Used>
</Panes>
</DockScreen>
<!-- The almighty wrench!! -->
<ItemType UNID="&itAlmightyWrench;"
name= "Almighty Wrench"
level= "1"
value= "25"
mass= "1"
frequency= "common"
numberAppearing= "1"
modifiers= "MinorItem"
showReference= "true"
esPlural= "true"
useScreen= "&dsUseWrench;"
description= "Even in space things get damaged. This wrench is the one and only wrench, made to fix those things that break! Of course, when working with things that are tougher or just don't work with wrenches, this can be tough."
sortName= "almighty wrench"
>
<Image imageID="&rsWrench;" imageX="0" imageY="0" imageWidth="96" imageHeight="96"/>
</ItemType>
</TranscendenceExtension>
Edit 9/28
Seems I had made an error before submitting the changes. It should be fixed now.