Skip to content

Commit

Permalink
don't calculate max_experience manually
Browse files Browse the repository at this point in the history
  • Loading branch information
gfgtdf committed Jan 14, 2015
1 parent 886a7f0 commit b67c5fd
Showing 1 changed file with 1 addition and 74 deletions.
75 changes: 1 addition & 74 deletions data/campaigns/tutorial/utils/utils.cfg
Expand Up @@ -154,85 +154,12 @@
# Note: we would not like the user to "press any key" (for example, Esc)
#enddef

#define CHECK_INTELLIGENT NAME
[if]
[variable]
# Ignoring single-trait units, as we don't have those during the tutorial
name={NAME}.modifications.trait.length
equals=2
[/variable]
[then]
[if]
[variable]
name={NAME}.modifications.trait[0].id
equals=intelligent
[/variable]
[or]
[variable]
name={NAME}.modifications.trait[1].id
equals=intelligent
[/variable]
[/or]
[then]
{VARIABLE is_intelligent yes}
[/then]
[else]
{VARIABLE is_intelligent no}
[/else]
[/if]
[/then]
[else]
{VARIABLE is_intelligent no}
[/else]
[/if]
#enddef

#define IMPORTANT_UNIT NAME
{CHECK_INTELLIGENT {NAME}}
[if]
# Archer needs 44/35(intelligent), Fighter needs 40/32
[variable]
name={NAME}.type
equals=Elvish Archer
[/variable]
{BOOLEQ is_intelligent no}
[variable]
name={NAME}.experience
greater_than=35
greater_than=$(${NAME}.max_experience - 8)
[/variable]
[or]
[variable]
name={NAME}.type
equals=Elvish Archer
[/variable]
{BOOLEQ is_intelligent yes}
[variable]
name={NAME}.experience
greater_than=26
[/variable]
[/or]
[or]
[variable]
name={NAME}.type
equals=Elvish Fighter
[/variable]
{BOOLEQ is_intelligent no}
[variable]
name={NAME}.experience
greater_than=31
[/variable]
[/or]
[or]
[variable]
name={NAME}.type
equals=Elvish Fighter
[/variable]
{BOOLEQ is_intelligent yes}
[variable]
name={NAME}.experience
greater_than=23
[/variable]
[/or]
[then]
{VARIABLE commented 0}
{FOREACH galdrad_comments i}
Expand Down

0 comments on commit b67c5fd

Please sign in to comment.