dataCable: pluggable connector

This commit is contained in:
He4eT 2020-03-15 18:04:33 +05:00
commit 8cfa2cf198
4 changed files with 38 additions and 5 deletions

View file

@ -1,7 +1,34 @@
dataCable: Thing, RoomPart
'data cable/wire/cord'
dataCable: PlugAttachable, Attachable, RoomPart
'data cable/wire/cord/jack/plug'
'data cable'
@redRoom
"Thick data cable with damaged connector."
location = redRoom
explainCannotAttachTo(obj) {
obj != dataPort
? "This data cable can only be connected to the data port."
: jack.isBroken
? "The connector on data cable is broken."
: "";
}
canAttachTo(obj) {
return !jack.isBroken && obj == dataPort;
}
;
+ jack: Component
'connector'
'connector'
"<<jack.isBroken
? 'Broken connector.
<br>One of the components of its body should be
fixed with glue, duct tape or something similar.'
: 'Fixed connector.
<br>The broken part is held carelessly.'
>>"
dobjFor (AttachTo) remapTo(AttachTo, dataCable, IndirectObject)
isBroken = true;
;

View file

@ -28,8 +28,8 @@ tapeWall: Thing, RoomPartItem
}
dobjFor (Doff) remapTo(Remove, self)
dobjFor (Break) remapTo(Remove, self)
dobjFor (Pull) remapTo(Remove, self)
dobjFor (Break) remapTo(Remove, self)
dobjFor (Take) {
action () {