Ci-dessous, les différences entre deux révisions de la page.
Prochaine révision | Révision précédenteProchaine révisionLes deux révisions suivantes | ||
agi-game:leisuresuitlarry:reference-timer [2021/05/02 18:16] – créée frater | agi-game:leisuresuitlarry:reference-timer [2021/05/02 21:42] – [varTimerBreathSpraySeconds [v80]] frater | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
+ | ====== Timing and Timers ====== | ||
+ | |||
Larry is using a lot of timing and timer, their are all handled by logic0. | Larry is using a lot of timing and timer, their are all handled by logic0. | ||
+ | |||
+ | <code c> | ||
+ | #define varTimeLastElapsedSeconds | ||
+ | #define varTimingDelay | ||
+ | #define varClearStatusSeconds | ||
+ | #define varTimerSpraySeconds | ||
+ | #define varTimerSprayMinutes | ||
+ | #define varTimerBreathSpraySeconds | ||
+ | #define varSecondsSinceKeystroke | ||
+ | #define varGameTimeSecond | ||
+ | #define varGameTimeMinute | ||
+ | #define varGameTimeHour | ||
+ | </ | ||
Due to the " | Due to the " | ||
- | ====== In game Time ====== | + | ===== In game Time ===== |
The timing Handler increase seconds , until seconds reach 60. (To avoid the " | The timing Handler increase seconds , until seconds reach 60. (To avoid the " | ||
<code c> | <code c> | ||
- | #define varGameTimeHour | ||
- | #define varGameTimeMinute | ||
#define varGameTimeSecond | #define varGameTimeSecond | ||
+ | #define varGameTimeMinute | ||
+ | #define varGameTimeHour | ||
</ | </ | ||
The Time is also handled by variables v119 [H], v116 [M] and v115 [S] those variables are set to start the ingame clock at 10pm and has a special even if reach 4am (larry' | The Time is also handled by variables v119 [H], v116 [M] and v115 [S] those variables are set to start the ingame clock at 10pm and has a special even if reach 4am (larry' | ||
Ligne 16: | Ligne 32: | ||
According to the source code; it can be an issue if you're in that room (seconds could be over 60) but those 3 screens aren't really play screen. | According to the source code; it can be an issue if you're in that room (seconds could be over 60) but those 3 screens aren't really play screen. | ||
- | ====== Timers ====== | + | ===== Timers ===== |
+ | |||
Leisure suit larry is using at least 4 differents timers | Leisure suit larry is using at least 4 differents timers | ||
- | ===== varTimingDelay [v67] ===== | + | ==== varTimingDelay [v67] ==== |
- | This timer only raise (Set) the boolTimingDelayOut [f75] when reach 1 second left (not 0, to avoid loop to 255 (-1) value). | + | |
- | The logic change the variable to what value they want to wait, and pool the boolTimingDelayOut | + | <code c> |
+ | #define varTimingDelay | ||
+ | </ | ||
+ | |||
+ | This timer is used by any room logic to set a timer (example, if larry won't move, after few second the dog came in). | ||
+ | |||
+ | This timer only raise (Set) the // | ||
+ | |||
+ | Any room logic can change the variable to what value they want to wait, and pool the // | ||
The timing Handler decrease the value until it's reach 1. | The timing Handler decrease the value until it's reach 1. | ||
- | ===== v68 ===== | + | ==== varClearStatusSeconds [v68] ==== |
- | This timer clear part of the line #24 when reach 1 second left. | + | |
+ | This timer is used to clear part of the line #24 when reach 1 second left. | ||
It's used to clear bottom line. | It's used to clear bottom line. | ||
- | ===== v72 & v71 ===== | + | <code c> |
+ | if (varClearStatusSeconds | ||
+ | { | ||
+ | clear.text.rect(24, | ||
+ | } | ||
+ | </ | ||
+ | ==== varTimerSprayMinutes [v72] & varTimerSpraySeconds [v71] ==== | ||
- | The timing Handler decrease the v71 value until it's reach 0 (it can'nt be negative). | + | The timing Handler decrease the // |
- | If the v72 is > 0; the handler decrease v72, and reset v71 to 60. | + | If the // |
- | It's somehow related to alcool usage (0:04) and breath spray (10:00)... | + | It's somehow related to breath spray (10:00)... |
+ | |||
+ | when v71 == 1 and v72 == 0 (timer is over), then handler raise flag // | ||
- | when v71 == 1 and v72 == 0 (timer is over), then handler raise flag f107 and reset f66. | ||
it display message 157 to 160, and preset the next message in the list, loop to 157 if message > 160. | it display message 157 to 160, and preset the next message in the list, loop to 157 if message > 160. | ||
- | ===== v80 ===== | + | <code c> |
+ | if (varTimerSprayMinutes > 0 && | ||
+ | varTimerSpraySeconds <= 0) | ||
+ | { | ||
+ | --varTimerSprayMinutes; | ||
+ | varTimerSpraySeconds | ||
+ | } | ||
+ | |||
+ | |||
+ | if (varTimerSpraySeconds | ||
+ | varTimerSprayMinutes <= 0) | ||
+ | { | ||
+ | reset(boolMouthOK); | ||
+ | set(boolMouthSmellBad); | ||
+ | print.v(varMouthMessage); | ||
+ | ++varMouthMessage; | ||
+ | if (varMouthMessage > 160) | ||
+ | { | ||
+ | varMouthMessage | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | ==== varTimerBreathSpraySeconds [v80] ==== | ||
The timing Handler decrease the value until it's reach 1. | The timing Handler decrease the value until it's reach 1. | ||
- | It's started when Larry use his breath spray when boolDisabledRoomJump (f48) is set or in the currentRoom 0. | + | It's started when Larry use his breath spray when //boolDisabledRoomJump// (f48) is set or in the currentRoom 0. |
When this timer hit 1 second left, the player re-gain the larry' | When this timer hit 1 second left, the player re-gain the larry' | ||
- | it's also reset f34 flag. | + | it's also reset // |
+ | |||
+ | <code c> | ||
+ | if (varTimerBreathSpraySeconds == 1) | ||
+ | { | ||
+ | reset(boolDisabledRoomJump); | ||
+ | reset(boolKeepCycling); | ||
+ | set.view(ego, | ||
+ | start.motion(ego); | ||
+ | reset(boolDisablePlayer); | ||
+ | accept.input(); | ||
+ | print(" | ||
+ | } | ||
+ | </ |