Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Open sidebar
auraes
PunyInformFr
Commits
0a27ab5d
Commit
0a27ab5d
authored
Feb 14, 2021
by
auraes
💬
Browse files
Mise à jour Puny a041128
parent
95139bb2
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
60 additions
and
27 deletions
+60
-27
game/minimal.inf
game/minimal.inf
+1
-0
lib/globals.h
lib/globals.h
+7
-3
lib/grammar.h
lib/grammar.h
+32
-23
lib/messages.h
lib/messages.h
+13
-0
lib/puny.h
lib/puny.h
+2
-0
lib/releasenotes.txt
lib/releasenotes.txt
+5
-1
No files found.
game/minimal.inf
View file @
0a27ab5d
...
...
@@ -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;
...
...
lib/globals.h
View file @
0a27ab5d
...
...
@@ -580,13 +580,17 @@ Constant RUNTIME_ERRORS RTE_NORMAL;
#EndIf;
#EndIf;
#IfDef OPTIONAL_
FULL_
SCORE;
#IfDef OPTIONAL_SCORE
D
;
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
;
...
...
lib/grammar.h
View file @
0a27ab5d
...
...
@@ -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
);
p
rint
"finding sundry items^"
;
P
rint
Msg
(
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_SCORE
D
;
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_SCORE
D
;
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
...
...
lib/messages.h
View file @
0a27ab5d
...
...
@@ -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
)
!
...
...
lib/puny.h
View file @
0a27ab5d
...
...
@@ -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;
...
...
lib/releasenotes.txt
View file @
0a27ab5d
...
...
@@ -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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment