Skip to content

Commit

Permalink
Tutorial S1: followup previous commits
Browse files Browse the repository at this point in the history
- Removed need for quick trait by spawning quantain next to Delfador
- Disabled movement point tracking due to #3344
- Use only one [label] tag to place both labels
- Removed id's of later quintains, as they are not used
- added some whitespaces

[ci skip]
  • Loading branch information
sevu committed Jul 15, 2018
1 parent 1e04fa6 commit 894796a
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 36 deletions.
80 changes: 44 additions & 36 deletions data/campaigns/tutorial/scenarios/01_Tutorial_part_1.cfg
Expand Up @@ -80,7 +80,6 @@
{IS_HERO}
[modifications]
{TRAIT_INTELLIGENT}
{TRAIT_QUICK}
[object]
[effect]
apply_to=new_animation
Expand Down Expand Up @@ -266,17 +265,30 @@
message= _ "Quiet! I will summon an enemy for you..."
[/message]

# Delfador steps 2 hexes northeast to a new summoning position
{MOVE_UNIT (id=Delfador) 15 4}
{MODIFY_UNIT (id=Delfador) facing sw}

# Adjust Delfador's MP as if he really moved
[lua]
code= <<
local unit = wesnoth.get_units({id = "Delfador"})[1]
unit.moves = 5
>>
[/lua]
# Explicitly check if the spot is free. The place where the engine
# would place the unit (nw of it) is less helpful, because the place
# where Delfador moves later is then more than 5 moves away.
[if]
[not]
[have_unit]
x=14
y=4
[/have_unit]
[/not]
[then]
# Delfador steps 1 hex northeast to a new summoning position
{MOVE_UNIT (id=Delfador) 14 4}
{MODIFY_UNIT (id=Delfador) facing sw}
[/then]
[else]
# Delfador steps 1 hex southeast to a new summoning position
{MOVE_UNIT (id=Delfador) 14 5}
{MODIFY_UNIT (id=Delfador) facing nw}
[/else]
[/if]

# Adjust Delfador's MP as if he really moved, disabled due to issue #3344
# {MODIFY_UNIT (id=Delfador) moves 5}

[scroll_to_unit]
id=Delfador
Expand Down Expand Up @@ -343,7 +355,6 @@
[/message]
)}

# wmllint: local spelling OK
{GENDER (
[message]
speaker=narrator
Expand Down Expand Up @@ -406,15 +417,24 @@
[/message]
)}

{MOVE_UNIT (id=Delfador) 14 8}

# Adjust Delfador's MP as if he really moved
[lua]
code= <<
local unit = wesnoth.get_units({id = "Delfador"})[1]
unit.moves = 0
>>
[/lua]
# Check where Delfador is, to set the remaining moves accordingly
[if]
[have_unit]
id=Delfador
x=14
y=4
[/have_unit]
[then]
{MOVE_UNIT (id=Delfador) 14 8}
# Adjust Delfador's MP as if he really moved, disabled due to issue #3344
# {MODIFY_UNIT (id=Delfador) moves 0}
[/then]
[else]
{MOVE_UNIT (id=Delfador) 14 8}
# Adjust Delfador's MP as if he really moved, disabled due to issue #3344
# {MODIFY_UNIT (id=Delfador) moves 2}
[/else]
[/if]

{MODIFY_UNIT (id=Delfador) facing nw}

Expand Down Expand Up @@ -475,17 +495,8 @@
text= _ "Village"
visible_in_fog=yes
visible_in_shroud=no
x=10
y=3
[/label]

[label]
immutable=yes
text= _ "Village"
visible_in_fog=yes
visible_in_shroud=no
x=11
y=7
x=10,11
y=3,7
[/label]

{GENDER (
Expand Down Expand Up @@ -900,23 +911,20 @@
[/color_adjust]

[unit]
id=Quintain1
type=Quintain
ai_special=guardian
x,y=16,10
side=2
[/unit]

[unit]
id=Quintain2
type=Quintain
ai_special=guardian
x,y=13,11
side=2
[/unit]

[unit]
id=Quintain3
type=Quintain
ai_special=guardian
x,y=9,11
Expand Down
3 changes: 3 additions & 0 deletions data/campaigns/tutorial/utils/utils.cfg
Expand Up @@ -38,10 +38,13 @@
[filter]
id=student
[/filter]

[allow_end_turn][/allow_end_turn]
[/event]

[event]
name=turn end

[remove_event]
id=prevent deadlock
[/remove_event]
Expand Down

0 comments on commit 894796a

Please sign in to comment.