QuoteThis definetely doesn't work as is written in requirement, because it checks step 4 before cleric starts to cast Protection from Fire not after.It isn't a big issue, but strictly speaking, in this case it means some unnoticeable difference in the game (even if it doesn't have any practical consequences for the tester/player).
QuoteAlthough the requirement also includes "instead of restarting from Step 1", solutions which use a correctly handled global variable will also be acceptedand
Quote[..]This also guarantees that the next character who the Cleric helps if needed will be the Fighter in all circumstances.
QuoteThis is almost correct, but cleric will cast Spiritual Hammer, even when he succesfully casts DUHM. He just needs to wait 10 rounds, and when the spell's effect wears off he will cast Spiritual Hammer.Good spot! Reference implementation deserves penalty points
A new block is needed and some lines, so it means one more block, +4 effective lines for the script altogeher. Of course, I noticed it has some other minor flaws as well (I made it in a short time), e.g. it checks all types of Spiritual Hammers in the inventory, despite the fact that the creature file for the contest is fixed (i.e. has constant level, unless the Cleric had a level-up before the battle
Just kidding).QuoteIf he has been attacked by an enemy in the last script round and his hit points
are below 60%, he casts Draw Upon Holy Might (he has one memorized
instance). If he fails to cast Draw Upon Holy Might, he casts Spiritual
Hammer. If he has successfully received the hammer, a state transition happens
to S3.
IF
Global("bwcc_clericState", "global", 0)
!HaveSpell(CLERIC_DRAW_UPON_HOLY_MIGHT)
!StateCheck(Myself,STATE_DRAWUPONHOLYMIGHT)
HaveSpell(CLERIC_SPIRITUAL_HAMMER)
THEN
RESPONSE #100
Spell(Myself, CLERIC_SPIRITUAL_HAMMER)
ENDQuoteIf the Fighter is alive but has been attacked by fire at least 5 times so far and
Resist Fire/Cold hasn't been cast yet, he casts Protection from Fire on the
Fighter, and will not cast Resist Fire/Cold any more. He has one memorized
instance of Protection from Fire. When Protection from Fire has been
(successfully or unsuccessfully) cast, the Cleric must immediately move to the
next, fourth check (to learn whether the Fighter needs to be cured from
Feeblemind). That is, instead of following the usual priority order (i.e. instead
of restarting from Step 1), the conditions of Step 4 must be evaluated.
IF
Global("bwcc_clericState", "global", 0)
HaveSpell(CLERIC_PROTECTION_FROM_FIRE)
See("bwcc_f")
GlobalGT("bwcc_fireCounter", "global", 4)
THEN
RESPONSE #100
Spell("bwcc_f", CLERIC_PROTECTION_FROM_FIRE)
Continue()
END
IF
GlobalLT("bwcc_clericState", "global", 2)
HaveSpell(CLERIC_CURE_DISEASE)
See("bwcc_f")
StateCheck("bwcc_f", STATE_FEEBLEMINDED)
THEN
RESPONSE #100
Spell("bwcc_f", CLERIC_CURE_DISEASE)
ENDQuoteThe 2 points he lost are because bwcc_m.baf contains the two script blocks in wrong order. The requirements say that the mage "casts Shield, and then he casts Melf's Minute Meteors.", and not in reverse order.Ups, that's pretty stupid of me. Next time I have to read requirements at least twice