Code:
[+] Rewritten part of old ERM engine, which was responsible for conditions evaluations.
- It's now possible to use spaces and line feeds to decorate complex conditions.
Example:
!!if|i^Master_Warrior_Hero%(hero)^ <> (prevWasMasterWarrior)/
i^Master_Mage_Hero%(hero)^ <> (prevWasMasterMage)/
i^Master_Adventurer_Hero%(hero)^ <> (prevWasMasterAdventurer)/
i^Grandmaster_Warrior_Hero%(hero)^ <> (prevWasGrandmasterWarrior)/
i^Grandmaster_Mage_Hero%(hero)^ <> (prevWasGrandmasterMage)/
i^Grandmaster_Adventurer_Hero%(hero)^ <> (prevWasGrandmasterAdventurer);
; ...
!!en;
- It's now possible to use numbers in the left side of comparisons. Previosly they were treated as flags.
Example 1:
!!IF&1000>=(goldLeft):M^You have enough gold to buy the map^;
Example 2:
!#DC(EDU_MOD_VERSION) = 317;
!!if & (EDU_MOD_VERSION) < 320;
!!IF:M^You use old version of Edu mod. Please, update it^;
!!en;
- Single numeric or string values are casted to boolean now. For numbers it's the same as <> 0. For strings it's the same as <> ^^ (empty string).
Examples:
!!HE(CURRENT_HERO):W?(movePoints:y);
!!IF&(movePoints):M^Ok, you have some movement points^; same as &(movePoints)<>0
; Please, use >= operator in real code for anything, that can become negative. It's just an example
!!VR(inputText:z):S^test^;
!!IF&(inputText)/(inputText)<>^secret password^:M^You have entered wrong password!^; same as &(inputText)<>^^/(inputText)<>^secret password^