Changes between Version 1 and Version 2 of Ticket #10772, comment 2
- Timestamp:
- Dec 23, 2018, 1:20:31 AM (6 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #10772, comment 2
v1 v2 11 11 (method (eatMeal &tmp temp0) 12 12 (= temp0 0) 13 (cond 14 (global136 (-- global136) (= temp0 1)) 15 (((global9 at: 4) amount?) 16 ((global9 at: 4) 13 (cond 14 # If there're preemptively eaten meals, digest one. 15 (global136 16 (-- global136) 17 (= temp0 1) # Eaten. 18 ) 19 # Consumee rations, if available. 20 (((g9_gloryInv at: 4) amount?) 21 ((g9_gloryInv at: 4) 17 22 amount: (- ((global9 at: 4) amount?) 1) 18 23 ) 19 (if (not ((global9 at: 4) amount?)) 20 ((global9 at: 4) owner: 0) 24 # Rations exhausted. 25 (if (not ((g9_gloryInv at: 4) amount?)) 26 ((g9_gloryInv at: 4) owner: 0) 21 27 # More needs to be done here! 22 28 ) 23 (= temp0 1) 29 (= temp0 1) # Eaten. 24 30 ) 31 # Test "hungry" flag. 25 32 ((proc0_4 3) 26 33 (if (self useStamina: 8 0) 27 (global91 say: 1 6 5 1 0 28) 34 # "You're starving. You'd better 35 # find some food SOON!" 36 (g91_gloryMessager say: 1 6 5 1 0 28) 28 37 else 38 # hero dies 29 39 (proc26_0 8 28 995 1) 30 40 ) 31 41 ) 32 ((proc0_4 2) (proc0_2 3) (global91 say: 1 6 6 1 0 28)) 33 (else (proc0_2 2) (global91 say: 1 6 4 1 0 28)) 42 # Test "missed meal" flag. 43 ((proc0_4 2) 44 # Set "hungry" flag. 45 (proc0_2 3) 46 # "You're really getting hungry." 47 (g91_gloryMessager say: 1 6 6 1 0 28) 48 ) 49 (else 50 # Set "missed meal" flag. 51 (proc0_2 2) 52 # "You don't have any rations. You'd 53 # better get some food soon." 54 (g91_gloryMessager say: 1 6 4 1 0 28) 55 ) 34 56 ) 57 # If eaten, unset flags. 35 58 (if temp0 36 (cond 59 (cond 37 60 ((proc0_4 3) (proc0_3 3)) 38 61 ((proc0_4 2) (proc0_3 2))