User Tools

Site Tools


crpl:docs:setdigitalis

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
Last revisionBoth sides next revision
crpl:docs:setdigitalis [2015/03/27 02:34] – added sectiaon warrencrpl:docs:setdigitalis [2016/07/25 09:28] – fixed first example to reflect zero quirk, reorganized examples planetfall
Line 10: Line 10:
 An Amt of 1 means full health Digitalis, and 0 means no Digitalis. An Amt of 1 means full health Digitalis, and 0 means no Digitalis.
  
-=== Emulating the in game weapons ===+=== Zero quirk === 
 +FIXME This is based on experiment and observation, not source knowledge. 
 + 
 +Using this command to set the Digitalis level to zero results in never-regrowing Digitalis, even if there is Digitalis "growth" (pathway) present. Setting to -1 causes (seemingly) normal behaviour. Pressing "Delete Digitalis" in the editor returns cells to normal. 
 + 
 +=== Examples === 
 ^Weapon^Radius^Amount^ ^Weapon^Radius^Amount^
 |Blaster|1|.52| |Blaster|1|.52|
Line 17: Line 23:
 |Bertha|10|.7| |Bertha|10|.7|
  
-Note: blasters will not injure digitalis that is uphill ever.+  * ** Emulating the in game weapons **\\ %% %% \\ //
  
-<code>+Note: blasters will not injure digitalis that is uphill ever. //\\ %% %%\\ <code>
 #This function takes four arguments, a centre, then a range, then an amount. #This function takes four arguments, a centre, then a range, then an amount.
 :damageDigitalis :damageDigitalis
Line 32: Line 38:
       I dup mul j dup mul add <-r2 lte if       I dup mul j dup mul add <-r2 lte if
         #Translate to our site of action.         #Translate to our site of action.
-        I <-x0 add J <-x0 add dup2 +        I <-x0 add J <-y0 add dup2 
-            #DAMAGE! +            #Make sure to not inadvertently set digitalis to 0, making it never regrow 
-            GetDigitalis <-amount sub SetDigitalis          +            GetDigitalis ->DigiPresent 
 +            <-DigiPresent <-amount gt if 
 +                <-DigiPresent <-amount sub SetDigitalis 
 +            else 
 +                <-DigiPresent -1 SetDigitalis 
 +            endif
       endif       endif
     Loop     Loop
   Loop   Loop
 </code> </code>
- 
-=== Examples === 
  
   * **Lay down Digitalis on 3x3 grid under a unit**\\ %% %% \\ //The reason for the 2 is that the limit is one more than the loop iterates through.  So, "3 0 do loop" goes through the values 0,1,2... but not three. Using these limits  will make your walker lay down a 3x3 grid of Digitalis. //\\ %% %%\\ <code>   * **Lay down Digitalis on 3x3 grid under a unit**\\ %% %% \\ //The reason for the 2 is that the limit is one more than the loop iterates through.  So, "3 0 do loop" goes through the values 0,1,2... but not three. Using these limits  will make your walker lay down a 3x3 grid of Digitalis. //\\ %% %%\\ <code>
crpl/docs/setdigitalis.txt · Last modified: 2018/07/09 07:56 by GoodMorning