Dental floss; repair of the connector

This commit is contained in:
He4eT 2020-03-15 19:21:13 +05:00
commit 0a73200eb6
3 changed files with 35 additions and 5 deletions

View file

@ -1,9 +1,13 @@
dataCable: PlugAttachable, Attachable, RoomPart
'data cable/wire/cord/jack/plug'
'data cable/wire/cord'
'data cable'
@redRoom
"Thick data cable with damaged connector."
canAttachTo (obj) {
return !jack.isBroken && obj == dataPort;
}
explainCannotAttachTo(obj) {
obj != dataPort
? "This data cable can only be connected to the data port."
@ -12,13 +16,18 @@ dataCable: PlugAttachable, Attachable, RoomPart
: "";
}
canAttachTo(obj) {
return !jack.isBroken && obj == dataPort;
dobjFor (Repair) remapTo(Repair, jack)
dobjFor (RepairWith) remapTo(Repair, self)
dobjFor (AttachTo) {
action () {
"Data cable pluged in.";
}
}
;
+ jack: Component
'connector'
'connector/jack'
'connector'
"<<jack.isBroken
? 'Broken connector.
@ -27,8 +36,19 @@ dataCable: PlugAttachable, Attachable, RoomPart
: 'Fixed connector.
<br>The broken part is held carelessly.'
>>"
isBroken = true
dobjFor (AttachTo) remapTo(AttachTo, dataCable, IndirectObject)
isBroken = true;
dobjFor (Repair) {
verify() {
illogical('This connector can be fixed
with glue, duck tape or something similar.');
}
}
dobjFor (RepairWith) {
verify() {
illogical('Code here');
}
}
;

9
src/item/dentalFloss.t Normal file
View file

@ -0,0 +1,9 @@
dentalFloss: Thing
'dental floss'
'dental floss'
@me
" A cord of thin filaments
used to remove food and dental plaque
from between teeth in areas
a toothbrush is unable to reach."
;