User Tools

Site Tools


ixe:features:units:cbomb

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
ixe:features:units:cbomb [2024/12/05 10:24] Grabzixe:features:units:cbomb [2025/02/14 14:57] (current) – external edit 127.0.0.1
Line 5: Line 5:
  
 ===== Unit Stats ===== ===== Unit Stats =====
-  * Requires ---- Energy to construct.+  * Requires 44.8 Energy to construct
 +  * Maximum ammo capacity of 250.
   * Fits in a box of 20 by 21 terrain pixels.   * Fits in a box of 20 by 21 terrain pixels.
  
Line 18: Line 19:
 ===== Spoilers ===== ===== Spoilers =====
 <hidden Unit JSON> <hidden Unit JSON>
-(Unit JSON)+<code javascript> 
 +
 + "type": "unit", 
 + "displayname": "CBomb", 
 + "permanentinventory": true, 
 + "image": "body.png", 
 + "position": [0, 0], 
 + "pivot": [0.5, 0.5], 
 + "movable": true, 
 + "maxammo": 250, 
 + "parts":
 + {"part": "armed.json", "name": "armed", "position": [0, 0], "active": false}, 
 + ], 
 + "controllers":
 + {"name": "ondestroy_sandexplosion"
 + ], 
 + "scripts":
 + {"name": "cbomb.irpl"
 +
 +
 +</code> 
 +The associated cbomb.irpl script: 
 +<code> 
 +$RANGE:30 
 + 
 +if (<-armed !) 
 + if (GetAmmo(self) GetMaxAmmo(self) >=) 
 + SetActive(<-armedPart true) 
 + true ->armed 
 + endif 
 +endif  
 + 
 +:Awake 
 + GetChild(self "armed") ->armedPart 
 + false ->armed 
 + 
 +:Destroyed 
 + if (GetAmmo(self) GetMaxAmmo(self) >=) 
 + GetAllPixelCount(self) ->pixelCounts 
 + <-pixelCounts[0] ->pixel_none 
 + <-pixelCounts[1] ->pixel_onboard 
 + <-pixelCounts[2] ->pixel_inroute 
 + <-pixelCounts[3] ->pixel_dead 
 + <-pixel_onboard <-pixel_dead + ->pixel_total 
 +  
 + if (<-pixel_total eq0) 
 + 0 ->percentComplete 
 + else 
 + <-pixel_total <-pixel_inroute - <-pixel_total asfloat / ->percentComplete 
 + endif  
 +  
 + #DebugAllSp("NONE:" <-pixel_none "ONBOARD:" <-pixel_onboard "INROUTE:" <-pixel_inroute "DEAD:" <-pixel_dead "TOTAL:" <-pixel_total) 
 + #DebugAllSp("% Complete: " <-percentComplete) 
 + GetPosition(self) ->pos 
 + ConvertCreeperToAC(<-pos.x <-pos.y <-RANGE <-percentComplete * false) 
 + endif  
 +</code>
 </hidden> </hidden>
  
 \\ \\
 {{page>navigation}} {{page>navigation}}
ixe/features/units/cbomb.1733394243.txt.gz · Last modified: 2025/02/14 14:56 (external edit)