Gumbo Snippets

Overview
Your number one resource for gumbo related snippets!

Check Ammo
Function that checks on the ammo of the Actor's current weapon. The script covers multiple situations regarding Actors ammo needs vs cover.

Source: gumbo_meleesoldier

[CHECK_AMMO] //Checks that current weapon actually has ammo IF IS SELF maxammo == 0 RETURN //Checks if the current weapon has less than 18% ammo and the actor is in cover IF IS SELF ammo <= maxammo*18/100 AND $(in_cover) RELOAD RUN DO_ATTACK RETURN //Checks if the current weapon has 0 ammo and the actor is in cover ELSEIF IS SELF ammo = 0 AND $(in_cover) RELOAD RUN DO_ATTACK RETURN //Checks if the current weapon has less than 18% ammo, the actor is not in cover, and has at least 2AP ELSEIF IS SELF ammo <= maxammo*18/100 AND ~(in_cover) AND AP >= 2 IF MOVEONLY in_cover, sweet_range, one_ap RELOAD RUN DO_ATTACK ELSEIF MOVEONLY in_cover, one_ap RELOAD RUN DO_ATTACK ELSEIF MOVEONLY in_cover, sweet_range, two_ap ELSEIF MOVEONLY in_cover, two_ap ELSEIF IS SELF ammo = 0 AND ~(in_cover) AND AP >= 2 IF MOVEONLY in_cover, sweet_range, one_ap RELOAD RUN DO_ATTACK ELSEIF MOVEONLY in_cover, one_ap RELOAD RUN DO_ATTACK ELSEIF MOVEONLY in_cover, sweet_range, two_ap ELSEIF MOVEONLY in_cover, two_ap ELSEIF IS SELF ammo <= maxammo*18/100 AND ~(in_cover) RELOAD ELSEIF IS SELF ammo = 0 AND ~(in_cover) AND AP = 1 RELOAD RETURN

Check Heal
Function that checks the current health of the Actor and attempts to heal itself.

Source: gumbo_meleesoldier

[CHECK_HEAL] IF SELECT INVENTORY $(heal) IF IS SELF hp < maxhp*4/10 AND $(in_cover) SELECT SELF DO $(heal) RETURN ELSEIF IS SELF hp < maxhp*4/10 SELECT ENEMY $(alive, in_range, in_sight) MOVE in_cover, sweet_range RETURN