about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorelioat <hi@eli.li>2023-12-09 18:03:03 -0500
committerelioat <hi@eli.li>2023-12-09 18:03:03 -0500
commit38c9c31f2ec8c4a55b80b379e87bc7b7ae37fcc2 (patch)
tree41dad93e4f06e5f7c657029361982bc16db3eb83
parentd75f7418a5528c173b7bd0e3cd343986892e76bc (diff)
downloaddecember-2023-38c9c31f2ec8c4a55b80b379e87bc7b7ae37fcc2.tar.gz
cooking with fire
-rw-r--r--decker/game.deck66
1 files changed, 55 insertions, 11 deletions
diff --git a/decker/game.deck b/decker/game.deck
index e393924..750e190 100644
--- a/decker/game.deck
+++ b/decker/game.deck
@@ -9,34 +9,57 @@ image:"%%IMG0AgABVgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
 {widgets}
 name:{"type":"field","size":[100,20],"pos":[128,32],"value":"Carl"}
 label-name:{"type":"field","size":[100,20],"pos":[16,32],"locked":1,"font":"menu","show":"transparent","value":"Name"}
-health:{"type":"field","size":[100,20],"pos":[128,60],"locked":1,"value":"437"}
+health:{"type":"field","size":[100,20],"pos":[128,60],"locked":1,"value":"150"}
 label-health:{"type":"field","size":[100,20],"pos":[16,60],"locked":1,"font":"menu","show":"transparent","value":"Health"}
-attack:{"type":"field","size":[100,20],"pos":[128,89],"locked":1,"value":"47"}
+attack:{"type":"field","size":[100,20],"pos":[128,89],"locked":1,"value":"85"}
 label-attack:{"type":"field","size":[100,20],"pos":[16,89],"locked":1,"font":"menu","show":"transparent","value":"Attack"}
-defense:{"type":"field","size":[100,20],"pos":[128,117],"locked":1,"value":"80"}
+defense:{"type":"field","size":[100,20],"pos":[128,117],"locked":1,"value":"34"}
 label-defense:{"type":"field","size":[100,20],"pos":[16,117],"locked":1,"font":"menu","show":"transparent","value":"Defense"}
 generate:{"type":"button","size":[160,32],"pos":[42,148],"script":"player.0","text":"Generate","style":"rect"}
 
 {script:player.0}
 on click do
- health.text:random[500 1]
- attack.text:random[100 1]
- defense.text:random[100 1]
+ health.text:random[500]
+ attack.text:random[100]
+ defense.text:random[100]
 end
 {end}
 
 {card:combat}
 script:"combat.0"
 {widgets}
-player:{"type":"grid","size":[292,140],"pos":[93,60],"script":"combat.1","widths":[32,32],"format":"sis","value":{"name":["Alice","Bob","Charlie"],"age":[23,25,17],"hobby":["running","cooking","birdwatching"]}}
+stats:{"type":"grid","size":[154,28],"pos":[30,287],"locked":1,"script":"combat.1","scrollbar":0,"lines":0,"format":"iii","value":{"health":["150"],"attack":["85"],"defense":["34"]},"row":0}
+enemy:{"type":"grid","size":[154,28],"pos":[327,39],"locked":1,"script":"combat.1","scrollbar":0,"lines":0,"format":"iii","value":{"health":[[239]],"attack":[[19]],"defense":[[16]]},"row":0}
+rest:{"type":"button","size":[60,20],"pos":[421,295],"script":"combat.2","text":"Rest"}
 
 {script:combat.0}
+on enemy do 
+ r:random[5]
+ if r>2
+  alert["attack"]
+ else 
+  alert["rest"]
+ end
+end
+
 on view do
- combat.widgets.player.value:insert name age hobby with
-   "Alice" 23 "running"
-    "Bob" 25 "cooking"
-    "Charlie" 17 "birdwatching"
+
+ ph:player.widgets.health.text
+ pa:player.widgets.attack.text
+ pd:player.widgets.defense.text
+ 
+ eh:random[300 1]
+ ea:random[100 1]
+ ed:random[50 1]
+ 
+ combat.widgets.stats.value:insert health attack defense with
+   ph pa pd
+ end
+ 
+ combat.widgets.enemy.value:insert health attack defense with
+   eh ea ed
  end
+ 
 end
 {end}
 
@@ -46,6 +69,27 @@ on click row do
 end
 {end}
 
+{script:combat.2}
+on click do
+
+ ph:player.widgets.health.text 
+ pa:player.widgets.attack.text 
+ pd:player.widgets.defense.text
+ 
+ v:random[10]
+ 
+ # update the source of truth
+ player.widgets.health.text:player.widgets.health.text+v
+ 
+ combat.widgets.stats.value:insert health attack defense with
+   ph pa pd
+ end
+ 
+ enemy[]
+ 
+end
+{end}
+
 {card:map}
 image:"%%IMG2AgABVgD/AP8A/wD/A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