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,6 +1,6 @@
me: Actor me: Actor
'me/self' 'me/self'
location = orangeRoom location = redRoom
posture = lying posture = lying
; ;

View file

@ -16,3 +16,9 @@ surgeryAssistant: Person
<br>You can see the message <q>Connection lost</q> on the indicator display." <br>You can see the message <q>Connection lost</q> on the indicator display."
isInitState = true isInitState = true
; ;
dataPort: PlugAttachable, Attachable, Fixture
'data port/outlet/socket'
'data port'
@redRoom
;

View file

@ -1,7 +1,34 @@
dataCable: Thing, RoomPart dataCable: PlugAttachable, Attachable, RoomPart
'data cable/wire/cord' 'data cable/wire/cord/jack/plug'
'data cable' 'data cable'
@redRoom
"Thick data cable with damaged connector." "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 (Doff) remapTo(Remove, self)
dobjFor (Break) remapTo(Remove, self)
dobjFor (Pull) remapTo(Remove, self) dobjFor (Pull) remapTo(Remove, self)
dobjFor (Break) remapTo(Remove, self)
dobjFor (Take) { dobjFor (Take) {
action () { action () {