Skip to content

Commit

Permalink
Tutorial S02: Make the grunt cross the bridge without bait (#4425)
Browse files Browse the repository at this point in the history
Not a code-revert, but a behavior-revert of the switch of this unit
to use the guardian AI. 26327a5.

If he somehow doesn't get across the bridge, warn the player
that something has broken.
  • Loading branch information
stevecotton committed Oct 5, 2019
1 parent 91b8453 commit 656a446
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 0 deletions.
2 changes: 2 additions & 0 deletions changelog.md
Expand Up @@ -8,6 +8,8 @@
* S1: Fix reference to LoW events
* The South Guard:
* Change Halidel to be Deoran's great-grandfather
* Tutorial:
* S2: Make the first grunt cross the bridge, otherwise the scenario is too hard
### Language and i18n
* Updated translations: Chinese (Simplified), Italian, Korean,
Portuguese (Brazil)
Expand Down
75 changes: 75 additions & 0 deletions data/campaigns/tutorial/scenarios/02_Tutorial_part_2.cfg
Expand Up @@ -484,6 +484,81 @@ A full list of abilities and weapons specials, along with traits, may be found i
)}
[/event]

# If the player didn't provide bait for Dumbo, the guardian AI won't move
# him, and that makes the scenario much harder than it should be. Hardcode
# the exact move that we want rather than switching to the normal AI, as
# the normal AI would probably take the village instead.
[event]
name=side 2 turn 2 end

[if]
[have_unit]
id=Dumbo
x,y=9,13
[/have_unit]
[not]
# Sanity check, if there's a unit anywhere here then the Guardian AI
# is expected to have attacked it; if not then something complex is
# happening (maybe the player already has a Ranger with Ambush).
#
# The sanity check isn't to see if the guardian AI has moved
# the unit, it's to check that moving from 9,13 to 9,8 doesn't
# walk through a ZoC. We're in a side-end-turn event and
# Dumbo's still on his starting point, so the guardian AI has
# already decided not to move him (or a unit managed to get to
# 9,12 for a fight, in which case let's show the sanity check
# failure message anyway).
[have_unit]
x=8-10
y=8-12
[/have_unit]
[/not]
[then]
[move_unit]
id=Dumbo
to_x,to_y=9,8
[/move_unit]
[/then]
[/if]

# Something has triggered the sanity check. If you want to test this,
# use a unit with Ambush to put a ZoC on his path (which the player
# won't have at this stage of the tutorial, any elvish archers that
# they have will be fresh recruits).
[if]
[have_unit]
id=Dumbo
[/have_unit]
[not]
[have_unit]
id=Dumbo
y=1-9
[/have_unit]
[/not]
# But not if the player has run on to the bridge themselves to attack.
# That does make it harder, but the player can likely attack from 2 or
# 3 sides, if they ignore the warning about attacking from water.
[not]
[have_unit]
side=1
[filter_adjacent]
id=Dumbo
[/filter_adjacent]
[/have_unit]
[/not]
[then]
[message]
speaker=narrator
caption= _ "The tutorial isn’t meant to be this difficult"
image=wesnoth-icon.png
message= _ "The orc on the island was supposed to move over the bridge, so that he could be attacked by several elves at once. Something’s broken the scripted event, which will make the scenario harder by leaving him in a defensive position.
Please report the bug."
[/message]
[/then]
[/if]
[/event]

[event]
name=turn 3

Expand Down

0 comments on commit 656a446

Please sign in to comment.