Commit ca18d013 authored by auraes's avatar auraes 💬
Browse files

Mise à jour Puny a81eea7

parent d553a7e3
......@@ -517,7 +517,7 @@ Verb 'inventaire' 'i//'
[ DropSub _p;
if(noun notin player) { PrintMsg(MSG_DROP_NOT_HOLDING); rtrue; }
if(_DisrobeIfWorn(noun)) rtrue;
if(_ImplicitDisrobeIfWorn(noun)) rtrue;
_p = parent(player);
!if(_p ~= location) <<Insert noun _p>>;
move noun to parent(player);
......@@ -652,8 +652,8 @@ Verb 'inventaire' 'i//'
rtrue;
}
if(noun ~=player && _GrabIfNotHeld(noun)) rtrue;
if(_DisrobeIfWorn(noun)) rtrue;
if(noun ~=player && _ImplicitGrabIfNotHeld(noun)) rtrue;
if(_ImplicitDisrobeIfWorn(noun)) rtrue;
! run before on receiver
#IfDef DEBUG;
......@@ -767,8 +767,8 @@ Verb 'inventaire' 'i//'
if (parent(noun) == second) { PrintMsg(MSG_PUTON_ALREADY); rtrue; }
_ancestor = CommonAncestor(noun, second);
if (_ancestor == noun) { PrintMsg(MSG_PUTON_ITSELF); rtrue; }
if(noun ~= player && _GrabIfNotHeld(noun)) rtrue;
if(_DisrobeIfWorn(noun)) rtrue;
if(noun ~= player && _ImplicitGrabIfNotHeld(noun)) rtrue;
if(_ImplicitDisrobeIfWorn(noun)) rtrue;
! run before on receiver
#IfDef DEBUG;
......@@ -803,7 +803,6 @@ Verb 'inventaire' 'i//'
_i = parent(noun);
if (_i has container && _i hasnt open) { PrintMsg(MSG_REMOVE_CLOSED, _i); rtrue; }
if (_i ~= second) { PrintMsg(MSG_REMOVE_NOT_HERE); rtrue; }
if (_i has animate) { PrintMsg(MSG_TAKE_ANIMATE); rtrue; }
if(TryToTakeNoun() == 1) rtrue;
action = ##Remove; if (AfterRoutines()) rtrue;
action = ##Take; if (AfterRoutines()) rtrue;
......@@ -889,10 +888,10 @@ Verb 'inventaire' 'i//'
];
[ ThrowAtSub;
if(_GrabIfNotHeld(noun)) rtrue;
if(_ImplicitGrabIfNotHeld(noun)) rtrue;
if(second == nothing) { PrintMsg(MSG_THROW_ANIMATE); rtrue; }
if(ObjectIsUntouchable(second)) return;
if(_DisrobeIfWorn(noun)) rtrue;
if(_ImplicitDisrobeIfWorn(noun)) rtrue;
if(second > 1) {
#IfDef DEBUG;
if(debug_flag & 1) print "(", (name) second, ").before()^";
......@@ -912,7 +911,7 @@ Verb 'inventaire' 'i//'
];
[ TransferSub;
if(_GrabIfNotHeld(noun)) rtrue;
if(_ImplicitGrabIfNotHeld(noun)) rtrue;
if (second has supporter) <<PutOn noun second>>;
!if (second == d_obj) <<Drop noun>>;
<Insert noun second>;
......@@ -1004,7 +1003,7 @@ Verb 'inventaire' 'i//'
if(_flag) break;
if(keep_silent == 0) print (name) _i, ": ";
if(selected_direction == d_to) {
_GrabIfNotHeld(_i);
_ImplicitGrabIfNotHeld(_i);
<Drop _i>;
} else
<Transfer _i _recipient>;
......@@ -1746,8 +1745,11 @@ Global scope_cnt;
! in the latter case.
! People cannot ordinarily be taken.
if(noun == player) { PrintMsg(MSG_TAKE_YOURSELF); rtrue; }
#Ifdef DisallowTakeAnimate;
if(noun has animate && DisallowTakeAnimate(noun)) { PrintMsg(MSG_TAKE_ANIMATE); rtrue; }
#Ifnot;
if(noun has animate) { PrintMsg(MSG_TAKE_ANIMATE); rtrue; }
#Endif;
_ancestor = CommonAncestor(player, noun);
if (_ancestor == 0) {
......
......@@ -514,7 +514,7 @@ Verb 'inventaire' 'i//'
[ DropSub _p;
if(noun notin player) { PrintMsg(MSG_DROP_NOT_HOLDING); rtrue; }
if(_DisrobeIfWorn(noun)) rtrue;
if(_ImplicitDisrobeIfWorn(noun)) rtrue;
_p = parent(player);
!if(_p ~= location) <<Insert noun _p>>;
move noun to parent(player);
......@@ -649,8 +649,8 @@ Verb 'inventaire' 'i//'
rtrue;
}
if(noun ~=player && _GrabIfNotHeld(noun)) rtrue;
if(_DisrobeIfWorn(noun)) rtrue;
if(noun ~=player && _ImplicitGrabIfNotHeld(noun)) rtrue;
if(_ImplicitDisrobeIfWorn(noun)) rtrue;
! run before on receiver
#IfDef DEBUG;
......@@ -764,8 +764,8 @@ Verb 'inventaire' 'i//'
if (parent(noun) == second) { PrintMsg(MSG_PUTON_ALREADY); rtrue; }
_ancestor = CommonAncestor(noun, second);
if (_ancestor == noun) { PrintMsg(MSG_PUTON_ITSELF); rtrue; }
if(noun ~= player && _GrabIfNotHeld(noun)) rtrue;
if(_DisrobeIfWorn(noun)) rtrue;
if(noun ~= player && _ImplicitGrabIfNotHeld(noun)) rtrue;
if(_ImplicitDisrobeIfWorn(noun)) rtrue;
! run before on receiver
#IfDef DEBUG;
......@@ -886,10 +886,10 @@ Verb 'inventaire' 'i//'
];
[ ThrowAtSub;
if(_GrabIfNotHeld(noun)) rtrue;
if(_ImplicitGrabIfNotHeld(noun)) rtrue;
if(second == nothing) { PrintMsg(MSG_THROW_ANIMATE); rtrue; }
if(ObjectIsUntouchable(second)) return;
if(_DisrobeIfWorn(noun)) rtrue;
if(_ImplicitDisrobeIfWorn(noun)) rtrue;
if(second > 1) {
#IfDef DEBUG;
if(debug_flag & 1) print "(", (name) second, ").before()^";
......@@ -909,7 +909,7 @@ Verb 'inventaire' 'i//'
];
[ TransferSub;
if(_GrabIfNotHeld(noun)) rtrue;
if(_ImplicitGrabIfNotHeld(noun)) rtrue;
if (second has supporter) <<PutOn noun second>>;
!if (second == d_obj) <<Drop noun>>;
<Insert noun second>;
......@@ -1001,7 +1001,7 @@ Verb 'inventaire' 'i//'
if(_flag) break;
if(keep_silent == 0) print (name) _i, ": ";
if(selected_direction == d_to) {
_GrabIfNotHeld(_i);
_ImplicitGrabIfNotHeld(_i);
<Drop _i>;
} else
<Transfer _i _recipient>;
......@@ -1743,8 +1743,11 @@ Global scope_cnt;
! in the latter case.
! People cannot ordinarily be taken.
if(noun == player) { PrintMsg(MSG_TAKE_YOURSELF); rtrue; }
#Ifdef DisallowTakeAnimate;
if(noun has animate && DisallowTakeAnimate(noun)) { PrintMsg(MSG_TAKE_ANIMATE); rtrue; }
#Ifnot;
if(noun has animate) { PrintMsg(MSG_TAKE_ANIMATE); rtrue; }
#Endif;
_ancestor = CommonAncestor(player, noun);
if (_ancestor == 0) {
......
......@@ -658,9 +658,10 @@ System_file;
return _ParseToken(p_token_type, p_token_data, -PHASE1);
];
[ _GrabIfNotHeld p_noun _ks;
[ _ImplicitGrabIfNotHeld p_noun _ks;
! return true if p_noun isn't held by the player at the end of the call
! (so that you can use it like: if(_GrabIfNotHeld(...)) { }
! (so that you can use it like: if(_ImplicitGrabIfNotHeld(...)) { }
if(actor ~= player) rfalse;
if(p_noun in player) rfalse;
PrintMsg(MSG_AUTO_TAKE, p_noun);
PronounNotice(p_noun);
......@@ -672,9 +673,10 @@ System_file;
rfalse;
];
[ _DisrobeIfWorn p_noun _ks;
[ _ImplicitDisrobeIfWorn p_noun _ks;
! return true if p_noun isn't held by the player at the end of the call
! (so that you can use it like: if(_GrabIfNotHeld(...)) { }
! (so that you can use it like: if(_ImplicitDisrobeIfWorn(...)) { }
if(actor ~= player) rfalse;
if(p_noun notin player || p_noun hasnt worn) rfalse;
PronounNotice(p_noun);
if(keep_silent == false)
......@@ -799,7 +801,7 @@ System_file;
if(_token_data == HELD_OBJECT && _noun notin player) {
phase2_necessary = PHASE2_ERROR;
if(p_phase == PHASE2) {
if(_GrabIfNotHeld(_noun)) {
if(_ImplicitGrabIfNotHeld(_noun)) {
return GPR_FAIL;
}
}
......
......@@ -383,3 +383,7 @@ v2.0: bug fix and new feature release (17 February 2021)
=======
v2.1: bug fix and new feature release
- New entry point routine: DisallowTakeAnimate. Have it return false if the
player should be able to pick up noun.
- Implicit actions only occur when the actor==player, to stop for example
"bob, give me knife" from doing unexpected things with the knife.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment