extended: tags: RuleItem: POISON_STRENGTH: int POISON_DURATION: int RuleArmor: POISON_SUSCEPTIBILITY: int BattleUnit: POISON_REMAINING: int POISON_LEVEL: int scripts: damageUnit: - offset: 1 code: | var int susceptibility 0; var int strength 0; var int duration 0; var int temp 0; var ptr RuleArmor armor_rule; var ptr RuleItem item_rule; unit.getRuleArmor armor_rule; armor_rule.getTag susceptibility Tag.POISON_SUSCEPTIBILITY; damaging_item.getRuleItem item_rule; item_rule.getTag strength Tag.POISON_STRENGTH; item_rule.getTag duration Tag.POISON_DURATION; debug_log 1 strength; debug_log 2 susceptibility; if and gt strength 0 gt susceptibility 0; unit.getTag temp Tag.POISON_LEVEL; if lt temp strength; unit.setTag Tag.POISON_LEVEL strength; end; unit.getTag temp Tag.POISON_REMAINING; if lt temp duration; unit.setTag Tag.POISON_REMAINING duration; end; end; return; newTurnUnit: - offset: 1 code: | var int poison; var int hp; var int duration 0; unit.getTag poison Tag.POISON_LEVEL; unit.getTag duration Tag.POISON_REMAINING; if gt poison 0; unit.getHealth hp; sub hp poison; unit.setHealth hp; sub duration 1; unit.setTag Tag.POISON_REMAINING duration; end; if le duration 0; unit.setTag Tag.POISON_LEVEL 0; end; return; recolorUnitSprite: - offset: 4 code: | var int poison; unit.getTag poison Tag.POISON_LEVEL; if gt poison 0; set_color new_pixel 5; # 4 green color end; return new_pixel; #items: # - type: STR_PISTOL_CLIP # tags: # POISON_STRENGTH: 6 #armors: # - type: STR_SOME_MARTIAN # tags: # POISON_SUSCEPTIBILITY: 20