! ==============================================================================
! VERBLIB: Front end to standard verbs library.
!
-! Supplied for use with Inform 6 -- Release 6.12.4 -- Serial number 200718
+! Supplied for use with Inform 6 -- Release 6.12.6 -- Serial number 220219
!
-! Copyright Graham Nelson 1993-2004 and David Griffith 2012-2020
+! Copyright Graham Nelson 1993-2004 and David Griffith 2012-2022
!
! This file is free software: you can redistribute it and/or modify
! it under the terms of the GNU Affero General Public License as
action = k;
}
- if (item has scenery) return L__M(##Take, 10, item);
if (item has static) return L__M(##Take, 11, item);
+ if (item has scenery) return L__M(##Take, 10, item);
! The item is now known to be available for taking. Is the player
! carrying too much? If so, possibly juggle items into the rucksack
ks = keep_silent; keep_silent = 2; AttemptToTakeObject(obj); keep_silent = ks;
if (obj notin actor) rtrue;
if (res == 0 && ~~keep_silent)
- if (supcon) L__M(##Miscellany, 58, obj, supcon);
- else L__M(##Miscellany, 26, obj);
+ if (supcon) return L__M(##Miscellany, 58, obj, supcon);
+ else return L__M(##Miscellany, 26, obj);
rfalse;
];
! ----------------------------------------------------------------------------
[ TakeSub;
+ if (noun in actor && noun has worn) <<Disrobe noun, actor>>;
if (onotheld_mode == 0 || noun notin actor)
if (AttemptToTakeObject(noun)) return;
if (AfterRoutines()) return;
[ RemoveSub i;
i = parent(noun);
if (i && i has container && i hasnt open && ImplicitOpen(i)) return L__M(##Remove, 1, i);
- if (i ~= second) return L__M(##Remove, 2, noun);
+ if (noun has clothing) {
+ if (noun has worn) <<Disrobe noun, actor>>;
+ if (i && i has container or supporter)
+ jump RSSkip;
+ else
+ if (i == actor) return L__M(##Disrobe, 1, noun);
+ }
+ if (i hasnt container && i hasnt supporter) return L__M(##Remove, 4, noun);
+ if (i ~= second && second ~= nothing) return L__M(##Remove, 2, noun);
if (i has animate) return L__M(##Take, 6, i, noun);
+ .RSSkip;
if (AttemptToTakeObject(noun)) rtrue;
-
action = ##Remove; if (AfterRoutines()) return;
action = ##Take; if (AfterRoutines()) return;
if (keep_silent) return;
[ DropSub;
if (noun == actor) return L__M(##PutOn, 4, noun);
if (noun in parent(actor)) return L__M(##Drop, 1, noun);
- if (noun notin actor && ~~ImplicitTake(noun)) return L__M(##Drop, 2, noun);
if (noun has worn && no_implicit_actions) return L__M(##Disrobe, 4, noun);
if (noun has worn && ImplicitDisrobe(noun)) return;
+ if (noun notin actor) {
+ if (no_implicit_actions) return L__M(##Drop, 4, noun, parent(noun));
+ L__M(##Miscellany, 58, noun, parent(noun));
+ }
+
move noun to parent(actor);
if (AfterRoutines() || keep_silent) return;
L__M(##Drop, 3, noun);
receive_action = ##PutOn;
if (second == d_obj || actor in second) <<Drop noun, actor>>;
if (parent(noun) == second) return L__M(##Drop, 1, noun);
- if (noun notin actor && ImplicitTake(noun)) return L__M(##PutOn, 1, noun);
+ if (ImplicitTake(noun) && noun notin actor) return L__M(##PutOn, 1, noun);
ancestor = CommonAncestor(noun, second);
if (ancestor == noun) return L__M(##PutOn, 2, noun);
action = ##PutOn;
}
if (second hasnt supporter) return L__M(##PutOn, 3, second);
- if (ancestor == actor) return L__M(##PutOn, 4, second);
+
+ if (noun has worn && no_implicit_actions) return L__M(##Disrobe, 4, noun);
if (noun has worn && ImplicitDisrobe(noun)) return;
if (ObjectDoesNotFit(noun, second) ||
receive_action = ##Insert;
if (second == d_obj || actor in second) <<Drop noun, actor>>;
if (parent(noun) == second) return L__M(##Drop, 1, noun);
- if (noun notin actor && ImplicitTake(noun)) return L__M(##Insert, 1, noun);
+ if (ImplicitTake(noun) && noun notin actor) return L__M(##Insert, 1, noun);
ancestor = CommonAncestor(noun, second);
if (ancestor == noun) return L__M(##Insert, 5, noun);
if (ObjectIsUntouchable(second)) return;
return L__M(##Insert, 3, second);
}
if (second hasnt container) return L__M(##Insert, 2, second);
+ if (noun has worn && no_implicit_actions) return L__M(##Disrobe, 4, noun);
if (noun has worn && ImplicitDisrobe(noun)) return;
if (ObjectDoesNotFit(noun, second) ||
if (ObjectIsUntouchable(noun)) return;
if (noun hasnt lockable) return L__M(##Unlock, 1, noun);
if (noun hasnt locked) return L__M(##Unlock, 2, noun);
- if (noun.with_key ~= second) return L__M(##Unlock, 3, second);
+ if ((noun.with_key ofclass Object && noun.with_key ~= second) ||
+ (noun.with_key ofclass Routine && noun.with_key() ~= second) ||
+ noun.with_key == nothing)
+ return L__M(##Unlock, 3, second);
give noun ~locked;
if (noun hasnt lockable) return L__M(##Lock, 1, noun);
if (noun has locked) return L__M(##Lock, 2 ,noun);
if (noun has open && ImplicitClose(noun)) return L__M(##Lock, 3, noun);
- if (noun.with_key ~= second) return L__M(##Lock, 4, second);
+ if ((noun.with_key ofclass Object && noun.with_key ~= second) ||
+ (noun.with_key ofclass Routine && noun.with_key() ~= second) ||
+ noun.with_key == nothing)
+ return L__M(##Lock, 4, second);
give noun locked;
if (AfterRoutines() || keep_silent) return;
if (noun has open) return L__M(##Open, 3, noun);
give noun open;
- if (keep_silent || AfterRoutines()) return;
+ if (AfterRoutines() || keep_silent) return;
if (noun hasnt container)
return L__M(##Open, 5, noun);
[ DisrobeSub;
if (ObjectIsUntouchable(noun)) return;
- if (noun hasnt worn) return L__M(##Disrobe, 1, noun);
+ if (noun hasnt clothing) return L__M(##Disrobe,1, noun);
+ if (noun hasnt worn && noun has clothing) return L__M(##Disrobe, 1, noun);
give noun ~worn;
if (AfterRoutines() || keep_silent) return;
[ WearSub;
if (ObjectIsUntouchable(noun)) return;
if (noun hasnt clothing) return L__M(##Wear, 1, noun);
- if (noun notin actor && ImplicitTake(noun)) return L__M(##Wear, 2, noun);
+
+ if (noun notin actor && noun hasnt worn) {
+ if (IndirectlyContains(actor, noun) || parent(noun) has container or supporter) {
+ if (no_implicit_actions) return L__M(##Wear, 5, noun, parent(noun));
+ L__M(##Miscellany, 58, noun, parent(noun));
+ AttemptToTakeObject(noun);
+ } else
+ return L__M(##Wear, 2, noun, parent(noun));
+ }
if (noun has worn) return L__M(##Wear, 3, noun);
give noun worn;
[ WaveSub;
if (noun == player) return L__M(##Wave, 2 ,noun, second);
if (noun == actor) return L__M(##Wave, 3, noun, second);
- if (noun notin actor && ImplicitTake(noun)) return L__M(##Wave, 1, noun);
+ if (ImplicitTake(noun) && noun notin actor) return L__M(##Wave, 1, noun);
L__M(##Wave, 2, noun, second);
];