Commit 2e06af4e authored by auraes's avatar auraes 💬
Browse files

Mise à niveau pour la version 3

parent 0a27ab5d
......@@ -24,8 +24,8 @@ Zcharacter 'û';
! V5 Avec ou sans accents à la saisie, mais pas dans le dictionnaire
! V5 Accents à la saisie et dans le dictionnaire
Constant PUNYINFORM_MAJOR_VERSION = 1;
Constant PUNYINFORM_MINOR_VERSION = 9;
Constant PUNYINFORM_MAJOR_VERSION = 2;
Constant PUNYINFORM_MINOR_VERSION = 0;
#Ifndef VN_1634;
Message fatalerror "*** La bibliothèque PunyInform a besoin d'Inform v6.34 ou d'une version ultérieure pour fonctionner ***";
......
......@@ -1851,14 +1851,10 @@ Global scope_cnt;
_door_to = _new_location.door_to;
#IfDef OPTIONAL_SIMPLE_DOORS;
if(_door_to == 0) {
! PunyDoor
_k = (_new_location.#found_in) / 2;
for(_i=0 : _i<_k : _i++)
if(real_location == _new_location.&found_in-->_i) {
_j = _i & $fffe;
if(_j == _i) _j++;
}
_new_location = _new_location.&found_in-->_j;
! This is a Simple Door, where door_to has been left out
if(real_location == _new_location.&found_in-->0)
_door_to = 1;
_new_location = _new_location.&found_in-->_door_to;
} else {
#EndIf;
! Normal Inform door
......
......@@ -540,19 +540,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
......@@ -1155,26 +1150,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);
......@@ -1384,21 +1393,21 @@ Verb meta 'verifier'
#Endif; ! NO_PLACES
[ ScriptOnSub;
transcript_mode = ((HDR_GAMEFLAGS-->0) & 1);
transcript_mode = ((HDR_FLAGS2-->0) & 1);
if (transcript_mode) "Une transcription est déjà en cours.";
@output_stream 2;
if (((HDR_GAMEFLAGS-->0) & 1) == 0) "La tentative de commencer la transcription a échoué.";
if (((HDR_FLAGS2-->0) & 1) == 0) "La tentative de commencer la transcription a échoué.";
print "Début de la transcription de^";
Banner();
transcript_mode = true;
];
[ ScriptOffSub;
transcript_mode = ((HDR_GAMEFLAGS-->0) & 1);
transcript_mode = ((HDR_FLAGS2-->0) & 1);
if (transcript_mode == false) "Aucune transcription n'est en cours.";
print "^Fin de la transcription.^";
@output_stream -2;
if ((HDR_GAMEFLAGS-->0) & 1) "Impossible de terminer la transcription.";
if ((HDR_FLAGS2-->0) & 1) "Impossible de terminer la transcription.";
transcript_mode = false;
];
......@@ -1584,10 +1593,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);
......@@ -1767,10 +1778,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;
......@@ -1793,11 +1806,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
......@@ -1840,14 +1849,10 @@ Global scope_cnt;
_door_to = _new_location.door_to;
#IfDef OPTIONAL_SIMPLE_DOORS;
if(_door_to == 0) {
! PunyDoor
_k = (_new_location.#found_in) / 2;
for(_i=0 : _i<_k : _i++)
if(real_location == _new_location.&found_in-->_i) {
_j = _i & $fffe;
if(_j == _i) _j++;
}
_new_location = _new_location.&found_in-->_j;
! This is a Simple Door, where door_to has been left out
if(real_location == _new_location.&found_in-->0)
_door_to = 1;
_new_location = _new_location.&found_in-->_door_to;
} else {
#EndIf;
! Normal Inform door
......
......@@ -154,14 +154,14 @@ Constant MSG_PARSER_NOSUCHTHING "Vous ne pouvez voir ou interagir avec cela."; !
#IfDef OPTIONAL_FULL_SCORE;
#IfDef OPTIONAL_SCORED;
#Ifndef MSG_FULLSCORE_OBJECTS;
Constant MSG_FULLSCORE_OBJECTS "finding sundry items";
Constant MSG_FULLSCORE_OBJECTS "finding sundry items"; !TODO
#EndIf;
#Ifndef MSG_FULLSCORE_ROOMS;
Constant MSG_FULLSCORE_ROOMS "visiting various places";
Constant MSG_FULLSCORE_ROOMS "visiting various places"; !TODO
#EndIf;
#EndIf;
#Ifndef MSG_FULLSCORE_ACTIONS;
Constant MSG_FULLSCORE_ACTIONS "performing noteworthy actions";
Constant MSG_FULLSCORE_ACTIONS "performing noteworthy actions"; !TODO
#EndIf;
#EndIf;
!
......@@ -658,13 +658,13 @@ MSG_RUB_DEFAULT, MSG_SQUEEZE_DEFAULT:
#EndIf;
#IfTrue MSG_RESTART_RESTORE_OR_QUIT < 1000;
MSG_RESTART_RESTORE_OR_QUIT:
print "^Voulez-vous recommencer, charger une partie sauvegardée";
print "^Voulez-vous Recommencer, Charger une partie sauvegardée";
#EndIf;
#IfDef OPTIONAL_FULL_SCORE;
print ", voir votre score Total";
#EndIf;
if(deadflag == 2 && AMUSING_PROVIDED == 0) print ", voir quelques actions bonus amusantes";
print " ou quitter ? ";
if(deadflag == 2 && AMUSING_PROVIDED == 0) print ", voir quelques actions Bonus amusantes";
print " ou Quitter ? ";
rtrue;
#IfTrue MSG_AREYOUSUREQUIT < 1000;
MSG_AREYOUSUREQUIT: ! print and rtrue to avoid newline
......
......@@ -358,7 +358,7 @@ v1.9: bug fix and new feature release (17 January 2021)
with strict error-checking.
=======
v2.0: bug fix and new feature release
v2.0: bug fix and new feature release (17 February 2021)
- Added OPTIONAL_SIMPLE_DOORS for an easier way to create doors, which also
saves space if you have more than six doors.
......@@ -379,3 +379,7 @@ v2.0: bug fix and new feature release
- 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
=======
v2.1: bug fix and new feature release
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