Paste #127024: Diff Report Between Paste #127023 and #126698

Date: 2024/10/03 12:06:23 UTC-07:00
Type: Diff Report

View Raw Paste Download This Paste Edit Of Paste 127023
Copy Link


+Primed_Cfour:
+    type: item
+    material: stone_button
+    display name: Primed C4
+    enchantments:
+    - Lure:1
 CFour:
     type: item
     material: stone_button
     display name: C4 Brick
 Detonator:
     type: item
     material: wooden_shovel
     display name: Detonator
 Detonate:
     type: world
     events:
         after player right clicks block with:Detonator:
-            - foreach <player.flag[Bombloc]>:
-                - explode power:8 <[value]> breakblocks
-                - narrate "detinating at <[value]>"
-            - flag <player> bombloc:!
-            - remove <player.flag[bombloc]>
+            - if <player.flag[numberobombsplaced]> == 0:
+                - narrate "No C4 has been placed"
+            - if <player.flag[numberobombsplaced]> != 0:
+                - foreach <player.flag[bombloc]> as:ExplosionOrigin :
+                    - explode power:8 <[ExplosionOrigin]> breakblocks
+                    - narrate "detinating at <[ExplosionOrigin]>"
+                - foreach <[EntityBombLoc]>:
+                    - explode power:8 <[EntityBombloc]>
+                    - narrate "Killed by primed_C4 in inventory"
+                - flag <player> numberobombsplaced:0
+                - flag <player> Bombloc:!
 PlaceCfour:
     type: world
     events:
         after player places CFour:
             - flag <player> Bombloc:->:<player.cursor_on>
+            - flag <player> NumberOBombsPlaced:++
             - narrate "C4 placed"
+        after player breaks stone_button:
+            - if <player.flag[Bomloc].is_within[3]>:
+                - explode power:8 <context.location> breakblocks
+                - foreach <context.location.is_within[3]>:
+                    - flag <player> Bombloc:<-:<context.location>
+                - flag <player> numberobombsplaced:--
+                - narrate boom!
+        after player right clicks entity with:CFour:
+            - inventory set:flag origin:Primed_Cfour destination:<context.entity.inventory> slot:10 EntityBombLoc:<context.entity.location>
+            - take item:Cfour
+            - flag <player> numberobombsplaced:++