Skip to content

Commit

Permalink
removed unused routines. updated game engine.
Browse files Browse the repository at this point in the history
  • Loading branch information
daelsepara committed Oct 16, 2024
1 parent 208ceb2 commit 466a574
Show file tree
Hide file tree
Showing 8 changed files with 129 additions and 114 deletions.
2 changes: 1 addition & 1 deletion src/coilshate.zil
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<CONSTANT GAME-TITLE "||Coils of Hate">
<CONSTANT GAME-DESCRIPTION "|Mark Smith (1993)||Implemented in ZIL by SD Separa (2024)|">
<CONSTANT RELEASEID 1>
<CONSTANT RELEASEID 2>
<CONSTANT IFID "E9645FAB-3F64-473C-AD76-C96D5F23868D">
<VERSION XZIP>

Expand Down
52 changes: 51 additions & 1 deletion src/common.zil
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,27 @@
<MOVE .SKILL ,LOST-SKILLS>
)>>

; "helper functions/constants when damage is dealt to player"
<ROUTINE LOSE-SKILLS ("OPT" MAX)
<COND (<NOT .MAX> <SET MAX 1>)>
<LOSE-STUFF ,SKILLS ,LOST-SKILLS "skill" .MAX RESET-SKILLS>>


; "deaths"
; ---------------------------------------------------------------------------------------------
<CONSTANT DIED-IN-COMBAT "You died in combat">
<CONSTANT DIED-OF-HUNGER "You starved to death">
<CONSTANT DIED-GREW-WEAKER "You grew weaker and eventually died">
<CONSTANT DIED-FROM-INJURIES "You died from your injuries">
<CONSTANT DIED-FROM-COLD "You eventually freeze to death">
<CONSTANT DIED-OF-THIRST "You go mad from thirst">
<CONSTANT KILLED-AT-ONCE "You are killed at once">

; "miscellaneous notifications"
; ---------------------------------------------------------------------------------------------
<CONSTANT NATURAL-HARDINESS "Your natural hardiness made you cope better with the situation">

; "helper functions/constants when damage is dealt to player"
; ---------------------------------------------------------------------------------------------
<ROUTINE PREVENT-DEATH ("OPT" STORY)
<COND (<NOT .STORY> <SET STORY ,HERE>)>
<COND (<GETP .STORY ,P?DEATH> <PUTP .STORY ,P?DEATH F>)>>
Expand Down Expand Up @@ -179,3 +192,40 @@
)>
)>
<RETURN 0>>

<ROUTINE LOSE-STUFF (CONTAINER LOST-CONTAINER ITEM "OPT" MAX ACTION "AUX" (COUNT 0) ITEMS)
<COND (<NOT .MAX> <SET MAX 1>)>
<COND (<G? <COUNT-CONTAINER .CONTAINER> .MAX>
<RESET-TEMP-LIST>
<SET ITEMS <COUNT-CONTAINER .CONTAINER>>
<DO (I 1 .ITEMS)
<SET COUNT <+ .COUNT 1>>
<COND (<L=? .COUNT .ITEMS>
<PUT TEMP-LIST .COUNT <GET-ITEM .I .CONTAINER>>
)>
>
<REPEAT ()
<COND (.ACTION <APPLY .ACTION>)>
<SELECT-FROM-LIST TEMP-LIST .COUNT .MAX .ITEM .CONTAINER "retain">
<COND (<EQUAL? <COUNT-CONTAINER .CONTAINER> .MAX>
<CRLF>
<TELL "You have selected: ">
<PRINT-CONTAINER .CONTAINER>
<CRLF>
<TELL "Do you agree?">
<COND (<YES?> <RETURN>)>
)(ELSE
<CRLF>
<HLIGHT ,H-BOLD>
<TELL "You must select " N .MAX " " .ITEM>
<COND (<G? .MAX 1> <TELL "s">)>
<TELL ,PERIOD-CR>
<HLIGHT 0>
)>
>
<DO (I 1 .COUNT)
<COND (<NOT <IN? <GET TEMP-LIST .I> .CONTAINER>>
<MOVE <GET TEMP-LIST .I> .LOST-CONTAINER>
)>
>
)>>
16 changes: 0 additions & 16 deletions src/endings.zil
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,3 @@
<CONSTANT BAD-ENDING "Your adventure ends here.|">

<CONSTANT GOOD-ENDING "You saved your people from annihilation.|">

; "deaths"
; ---------------------------------------------------------------------------------------------
<CONSTANT DIED-IN-COMBAT "You died in combat">

<CONSTANT DIED-OF-HUNGER "You starved to death">

<CONSTANT DIED-GREW-WEAKER "You grew weaker and eventually died">

<CONSTANT DIED-FROM-INJURIES "You died from your injuries">

<CONSTANT DIED-FROM-COLD "You eventually freeze to death">

; "miscellaneous notifications"
; ---------------------------------------------------------------------------------------------
<CONSTANT NATURAL-HARDINESS "Your natural hardiness made you cope better with the situation">
40 changes: 0 additions & 40 deletions src/food-routines.zil

This file was deleted.

9 changes: 0 additions & 9 deletions src/food.zil

This file was deleted.

98 changes: 77 additions & 21 deletions src/gamebook.zil
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,8 @@
<INSERT-FILE "codewords">
<INSERT-FILE "numbers">
<INSERT-FILE "currency">
<INSERT-FILE "food">
<INSERT-FILE "vehicle">
<INSERT-FILE "common">
<INSERT-FILE "endings">
;<INSERT-FILE "food-routines">
;<INSERT-FILE "vehicle-routines">

<SET REDEFINE T>

Expand Down Expand Up @@ -129,6 +125,12 @@
(ADJECTIVE GIVE)
(FLAGS CONTBIT OPENBIT)>

<OBJECT LOST-BAG
(DESC "stuff lost")
(SYNONYM BAG)
(ADJECTIVE LOST)
(FLAGS CONTBIT OPENBIT)>

; "pause routines"
; ---------------------------------------------------------------------------------------------
<ROUTINE PRESS-BEGIN ()
Expand Down Expand Up @@ -641,6 +643,77 @@
)>
)>>

; "charged items"
; ---------------------------------------------------------------------------------------------
<ROUTINE DISCHARGE-ITEM (ITEM "OPT" AMOUNT "AUX" (CHARGES 0))
<SET CHARGES <GETP .ITEM ,P?CHARGES>>
<COND (<G? .CHARGES 0>
<COND (<NOT .AMOUNT> <SET AMOUNT 1>)>
<SET CHARGES <- .CHARGES .AMOUNT>>
<COND (<L? .CHARGES 1> <SET CHARGES 0>)>
<PUTP .ITEM ,P?CHARGES .CHARGES>
)>>

<ROUTINE CHARGE-ITEM (ITEM MAX-CHARGE "OPT" AMOUNT "AUX" CHARGES)
<COND (<NOT .AMOUNT> <SET AMOUNT 1>)>
<SET CHARGES <GETP .ITEM ,P?CHARGES>>
<SET CHARGES <+ .CHARGES .AMOUNT>>
<COND (<G? .CHARGES .MAX-CHARGE> <SET CHARGES .MAX-CHARGE>)>
<PUTP .ITEM ,P?CHARGES .CHARGES>>

<ROUTINE TAKE-CHARGED-ITEM (ITEM "OPT" AMOUNT)
<COND (<NOT .AMOUNT> <SET AMOUNT 1>)>
<PUTP .ITEM ,P?CHARGES .AMOUNT>
<TAKE-ITEM .ITEM>>

<ROUTINE TAKE-OR-CHARGE (ITEM MAX-CHARGE "OPT" AMOUNT PROMPT PLURAL "AUX" TAKEN)
<COND (<NOT .AMOUNT> <SET AMOUNT 1>)>
<COND (<NOT .PLURAL> <SET PLURAL 1>)>
<COND (<AND .PROMPT <G? .PLURAL 1>>
<SET TAKEN <GET-NUMBER "You many will you take?" 0 .PLURAL>>
<COND (<L=? .TAKEN 0>
<RETURN 0>
)(ELSE
<SET PROMPT F>
<SET AMOUNT <* .TAKEN .AMOUNT>>
<SET PLURAL .TAKEN>
)>
)>
<COND (.PROMPT <CRLF>)>
<COND (<CHECK-ITEM .ITEM>
<COND (.PROMPT
<TELL "Take " T .ITEM>
<COND (<G? .PLURAL 1> <TELL "s' (" N .PLURAL ")">)(ELSE <TELL "'s">)>
<TELL " remaining ">
<COND (<G? .AMOUNT 1> <TELL N .AMOUNT " charges">)(ELSE <TELL "charge">)>
<TELL "?">
<COND (<YES?>
<CHARGE-ITEM .ITEM .MAX-CHARGE .AMOUNT>
<RETURN .PLURAL>
)>
)(ELSE
<CHARGE-ITEM .ITEM .MAX-CHARGE .AMOUNT>
<RETURN .PLURAL>
)>
)(ELSE
<COND (.PROMPT
<TELL "Take " T .ITEM>
<COND (<G? .PLURAL 1> <TELL "s (" N .PLURAL ")">)>
<TELL " (" N .AMOUNT " charge">
<COND (<G? .AMOUNT 1> <TELL "s">)>
<TELL " left)?">
<COND (<YES?>
<TAKE-CHARGED-ITEM .ITEM .AMOUNT>
<RETURN .PLURAL>
)>
)(ELSE
<TAKE-CHARGED-ITEM .ITEM .AMOUNT>
<RETURN .PLURAL>
)>
)>
<RETURN 0>>


; "story routines - actions/events"
; ---------------------------------------------------------------------------------------------
<ROUTINE GAIN-CODEWORD ("OPT" CODEWORD LOCATION)
Expand Down Expand Up @@ -702,15 +775,6 @@
<COND (<L? ,MONEY 0> <SETG MONEY 0>)>
<UPDATE-STATUS-LINE>>

<ROUTINE DISCHARGE-ITEM (ITEM "OPT" AMOUNT "AUX" (CHARGES 0))
<SET CHARGES <GETP .ITEM ,P?CHARGES>>
<COND (<G? .CHARGES 0>
<COND (<NOT .AMOUNT> <SET AMOUNT 1>)>
<SET CHARGES <- .CHARGES .AMOUNT>>
<COND (<L? .CHARGES 1> <SET CHARGES 0>)>
<PUTP .ITEM ,P?CHARGES .CHARGES>
)>>

<ROUTINE GAIN-ITEM ("OPT" LOCATION "AUX" ITEM)
<COND (<NOT .LOCATION> <SET LOCATION ,HERE>)>
<SET ITEM <GETP .LOCATION ,P?ITEM>>
Expand Down Expand Up @@ -1387,14 +1451,6 @@
<CRLF>
<PRINT-BOLD "Codewords: ">
<PRINT-CONTAINER ,CODEWORDS>
<COND (<FIRST? VEHICLES>
<CRLF>
<HLIGHT ,H-BOLD>
<PRINT-CAP-OBJ ,VEHICLE>
<TELL ": ">
<HLIGHT 0>
<PRINT-CONTAINER ,VEHICLES>
)>
<CRLF>
<HLIGHT ,H-BOLD>
<PRINT-CAP-OBJ ,CURRENCY>
Expand Down
20 changes: 0 additions & 20 deletions src/vehicle-routines.zil

This file was deleted.

6 changes: 0 additions & 6 deletions src/vehicle.zil

This file was deleted.

0 comments on commit 466a574

Please sign in to comment.