Commit 0a27ab5d authored by auraes's avatar auraes 💬
Browse files

Mise à jour Puny a041128

parent 95139bb2
......@@ -21,6 +21,7 @@ Constant OPTIONAL_NO_DARKNESS;
!Constant OPTIONAL_EXTENDED_METAVERBS;
!Constant OPTIONAL_EXTENDED_VERBSET;
!Constant OPTIONAL_PRINT_SCENERY_CONTENTS;
!Constant OPTIONAL_SCORED;
!Constant OPTIONAL_FULL_SCORE;
!Constant OPTIONAL_FULL_DIRECTIONS;
!Constant OPTIONAL_SIMPLE_DOORS;
......
......@@ -580,13 +580,17 @@ Constant RUNTIME_ERRORS RTE_NORMAL;
#EndIf;
#EndIf;
#IfDef OPTIONAL_FULL_SCORE;
#IfDef OPTIONAL_SCORED;
Attribute scored;
Global things_score;
Global places_score;
Default OBJECT_SCORE 4;
Default ROOM_SCORE 5;
#IfDef OPTIONAL_FULL_SCORE;
Global things_score;
Global places_score;
#Endif;
#Endif;
#IfDef OPTIONAL_FULL_SCORE;
#IfDef TASKS_PROVIDED;
Default NUMBER_TASKS 1;
Array task_done -> NUMBER_TASKS;
......
......@@ -543,19 +543,14 @@ Verb 'inventaire' 'i//'
PrintMsg(MSG_EAT_SUCCESS);
];
#IfDef OPTIONAL_SIMPLE_DOORS;
[ EnterSub _door_dir _i _k;
#IfNot;
[ EnterSub _door_dir;
#EndIf;
if(noun has door) {
#IfDef OPTIONAL_SIMPLE_DOORS;
_k = (noun.#door_dir) / 2;
if(_k > 1) {
! This is a PunyDoor
for(_i=0 : _i<_k : _i++)
if(real_location == noun.&found_in-->_i)
_door_dir = noun.&door_dir-->_i;
if(noun.#door_dir > 2) {
! This is a Simple Door, where door_dir is an array
if(real_location == noun.&found_in-->1)
_door_dir = 1;
_door_dir = noun.&door_dir-->_door_dir;
} else {
#EndIf;
! Normal Inform door
......@@ -1158,26 +1153,40 @@ Verb meta 'quitter' 'q//'
];
#IfDef OPTIONAL_FULL_SCORE;
[ FullScoreSub _i;
ScoreSub();
#IfDef TASKS_PROVIDED;
[ FullScoreSub _i _score_sum _sc;
#IfNot;
[ FullScoreSub _i _score_sum;
#EndIf;
new_line;
PrintMsg(MSG_FULLSCORE_START);
#IfDef TASKS_PROVIDED;
for(_i=0 : _i<NUMBER_TASKS : _i++)
if (task_done->_i == 1) {
PANum(task_scores->(_i));
PrintTaskName(_i);
}
_sc = task_scores->(_i);
PANum(_sc);
_score_sum = _score_sum + _sc;
PrintTaskName(_i);
}
#IfNot;
_i = 0; ! Avoid warning
#EndIf;
#IfDef OPTIONAL_SCORED;
if(things_score ~= 0) {
PANum(things_score);
print "finding sundry items^";
PrintMsg(MSG_FULLSCORE_OBJECTS);
}
if(places_score ~= 0) {
PANum(places_score);
print "visiting various places^";
PrintMsg(MSG_FULLSCORE_ROOMS);
}
_score_sum = score - _score_sum - things_score - places_score;
#IfNot;
_score_sum = score - _score_sum;
#EndIf;
if(_score_sum ~= 0) {
PANum(_score_sum);
PrintMsg(MSG_FULLSCORE_ACTIONS);
}
@new_line;
PANum(score);
......@@ -1586,10 +1595,12 @@ Global scope_cnt;
_top_ceil = _ceil;
if(_ceil == location) {
#IfDef OPTIONAL_FULL_SCORE;
#IfDef OPTIONAL_SCORED;
if(location has scored && location hasnt visited) {
score = score + ROOM_SCORE;
#IfDef OPTIONAL_FULL_SCORE;
places_score = places_score + ROOM_SCORE;
#EndIf;
}
#EndIf;
_PrintObjName(location);
......@@ -1769,10 +1780,12 @@ Global scope_cnt;
if(_AtFullCapacity(player)) { PrintMsg(MSG_TAKE_NO_CAPACITY); rtrue; }
#IfDef OPTIONAL_FULL_SCORE;
#IfDef OPTIONAL_SCORED;
if(noun hasnt moved && noun has scored) {
score = score + OBJECT_SCORE;
#IfDef OPTIONAL_FULL_SCORE;
things_score = things_score + OBJECT_SCORE;
#EndIf;
}
#EndIf;
move noun to player;
......@@ -1795,11 +1808,7 @@ Global scope_cnt;
rfalse;
];
#IfDef OPTIONAL_SIMPLE_DOORS;
[ GoDir p_property _new_location _door_to _vehicle _vehicle_mode _saved_location _i _j _k;
#IfNot;
[ GoDir p_property _new_location _door_to _vehicle _vehicle_mode _saved_location;
#EndIf;
if(parent(player) ~= real_location) {
! special rule when in enterable (veichles)
! before routine for the object is called with Go dir, and returns
......
......@@ -151,6 +151,19 @@ Constant MSG_PARSER_CANT_DISAMBIGUATE "Je ne comprends toujours pas à quoi vous
Constant MSG_PARSER_NOSUCHTHING "Vous ne pouvez voir ou interagir avec cela."; !FIXME
#EndIf;
#IfDef OPTIONAL_FULL_SCORE;
#IfDef OPTIONAL_SCORED;
#Ifndef MSG_FULLSCORE_OBJECTS;
Constant MSG_FULLSCORE_OBJECTS "finding sundry items";
#EndIf;
#Ifndef MSG_FULLSCORE_ROOMS;
Constant MSG_FULLSCORE_ROOMS "visiting various places";
#EndIf;
#EndIf;
#Ifndef MSG_FULLSCORE_ACTIONS;
Constant MSG_FULLSCORE_ACTIONS "performing noteworthy actions";
#EndIf;
#EndIf;
!
! complex messages (enumerated)
!
......
......@@ -1317,8 +1317,10 @@ Object thedark "L'obscurité"
deadflag = GS_PLAYING;
score = 0;
#IfDef OPTIONAL_FULL_SCORE;
#IfDef OPTIONAL_SCORED;
places_score = 0;
things_score = 0;
#EndIf;
#IfDef TASKS_PROVIDED;
for(_i = 0 : _i < NUMBER_TASKS : _i++) task_done->_i = 0;
#EndIf;
......
......@@ -374,4 +374,8 @@ v2.0: bug fix and new feature release
value of the constant DEFAULT_CAPACITY, which is 100 unless the game code
defines it.
- Added optional undo support
- Added OPTIONAL_SCORED to support the 'scored' attribute for places and
objects. NOTE: Games that use scored will now need to define this!
- Added a line to summary in FullScoreSub, for "noteworthy actions". This sums
up score added in code, like "score = score + 10;".
- Moved messages from FullScoreSub to messages.h
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