Conditions (Python)

Conditions

> Tutorial

In the previous chapter, we saw how to boost yourself, give yourself a shield and heal yourself. You've probably noticed that boosting and protecting yourself is always useful, but healing does nothing when your life is already at its maximum.

To avoid casting a heal and wasting TP , we'll use a condition, written like this:

This code casts the Bandage only if we're injured, that is, when our current life me.life is less than (` Which code(s) are valid?

if (me.life < me.maxLife) { me.useChip(Chip.bandage) } if me.life < me.maxLife me.useChip(Chip.bandage) if me.life < me.maxLife: me.useChip(Chip.bandage) else: me.useChip(Chip.helmet) if me.life < me.maxLife: me.useChip(Chip.bandage)

Full AI