66729 Commits

Author SHA1 Message Date
mattsc
bd1b45e814 ai_helper checked actions: move error string into call to error()
… rather than making it a separate message.
2016-10-21 17:25:11 -07:00
mattsc
d375321e64 Fast Micro AI: fix behavior with attack_hidden_enemies=yes
ai_helper.get_attacks() now excludes hidden enemies by default -> they
need to be specifically included if they are to be attacked, as opposed
to having to be excluded when not.
2016-10-21 17:25:11 -07:00
mattsc
cf731dd923 Wolves Micro AI: fix problem with target unit filtering 2016-10-21 17:25:11 -07:00
Wedge009
50146bc509 Avoid division by or modulo of zero in test scenario's maths test (bug #25214) 2016-10-22 11:06:12 +11:00
gfgtdf
15afec7202 fixup 'improve error message in case of an invalid unittype in [side]' 2016-10-21 23:11:08 +02:00
gfgtdf
2f6bb71b82 improve error message in case of an invalid unittype in [side]
Since the erromessage is now shown in ERR_NG_TC the user knowns tha this error happend during team creation.
2016-10-21 22:40:11 +02:00
Charles Dang
c47bede654 Merge pull request #836 from GregoryLundberg/GL_Fix_Lua_PANIC
Fix Lua stack corruption
2016-10-22 03:39:25 +11:00
mattsc
67fd4367fd Wolves Micro AI: better recovery from ambushes etc.
This is not necessary for most other Micro AIs, but this AI moves
several units per execution. If an ambush or failed teleport or similar
happens, it is better to reconsider rather than pull through with the
previously planned moves.
2016-10-21 07:59:03 -07:00
mattsc
348f64f4a0 Multipack Wolves Micro AI: better recovery from ambushes etc.
This is not necessary for most other Micro AIs, but this AI moves
several units per execution. If an ambush or failed teleport or similar
happens, it is better to reconsider rather than pull through with the
previously planned moves.
2016-10-21 07:53:24 -07:00
mattsc
74792845d7 ai_helper.movefull_stopunit: return action result to calling function 2016-10-21 07:26:26 -07:00
mattsc
13d2cdfc29 ai_helper checked actions: return action result to calling function 2016-10-21 07:22:45 -07:00
mattsc
204ccb0584 ai_helper: move checks for incomplete/empty moves to functions 2016-10-21 07:04:02 -07:00
mattsc
022d2cd725 ai_helper checked actions: some modifications to error messages 2016-10-21 06:46:41 -07:00
Gregory A Lundberg
e46f3a67bd Fix Lua stack corruption
Do NOT pop the error message off the stack.
It has already been popped.
2016-10-21 08:20:26 -05:00
mattsc
7647a4ad42 Fast Micro AI: replace tabs by spaces
To be consistent with the rest of the file.
2016-10-20 19:15:55 -07:00
mattsc
6ff7e1112d Fast Micro AI: clear all persistent variables after use 2016-10-20 19:15:55 -07:00
gfgtdf
00e008df5d attempt to fix use after free when advancing unit in test scenario
https://gna.org/bugs/?25204
2016-10-20 22:13:57 +02:00
Lari Nieminen
53758e0118 Merge pull request #701 from GregoryLundberg/GL_DM_final
Delfador's Memoirs fixes
2016-10-20 20:43:55 +03:00
mattsc
fef404fdb9 Fast Micro AI: simplify code by using new ai.aspect.attacks
Note that this requires that the enemy filter in the utils function now
matches the enemy units to be attacked, while previously it was set to
all enemy units NOT matching the filter. As this is not used anywhere
else, that’s not a problem, it’s just noted here for completeness.
2016-10-20 09:36:32 -07:00
mattsc
25eb3dd20f Fast Micro AI: fix attack_filter when excluding leader
“canrecruit = nil” does not give the same result as “canrecruit =
false” in a standard unit filter.
2016-10-20 09:36:32 -07:00
Gregory A Lundberg
c21166cd2f DM S12 Workaround: Primary unit unstable
[fire_event] should use [primary_unit] and [secondary_unit] from the call site unless specifically overridden. Since it fails to do so we have to re-set them explicitly.
2016-10-20 10:49:39 -05:00
Gregory A Lundberg
8c2f8b0a76 DM S12 Fix bug: Warning radius
Using radius is not as clear-cut as people think.
2016-10-20 10:49:39 -05:00
Gregory A Lundberg
7337e963f3 DM Fix bug: No save
Don't make the player re-play a scenario simply to read a cut-screne they skipped.
2016-10-20 10:49:39 -05:00
Gregory A Lundberg
a14d25eba9 DM Fix bug: Grammar 2016-10-20 10:49:39 -05:00
Gregory A Lundberg
984cf52d72 DM S11 Hide sides
No sense giving away that Chantal and the Orcs are here. Wait until Delfador learns of them to expose their sides.
2016-10-20 10:49:39 -05:00
Gregory A Lundberg
e0125ea121 DM S11 Fix bug: Chantal can move
Use a sighted event so Chantal speaks when first sighted, and since she can move from her citadel. Clear a bit of shroud around her.
2016-10-20 10:49:38 -05:00
Gregory A Lundberg
2e84f59f76 DM S11 Fix bug: Orc dies first
In the all-but-impossible case the orc leader dies before Delfador finds Chantal, wait until he finds her for victory.
2016-10-20 10:49:38 -05:00
Gregory A Lundberg
df785a4535 DM S07 Fix bug: Include advancements
The hint about heavy infantry should appear on advancements as well.
2016-10-20 10:49:38 -05:00
Gregory A Lundberg
906cb3b3a4 DM S06 Improve chest
Leave an open chest behind so the player knows they opened it already.
2016-10-20 10:49:38 -05:00
Gregory A Lundberg
f7ac9c6251 DM S05 Needlessly delayed 2016-10-20 10:49:38 -05:00
Gregory A Lundberg
68f7c0ec48 DM S04 Fix bug: No scenario-start saved
This means players must re-play the end of S04 if they wany to review the dialog in S05. Allowing the save made the event dead code; removed it all.
2016-10-20 10:49:38 -05:00
Gregory A Lundberg
bf24d087ce DM S04 Fix bug: Delfador was the victim
If Deflador is killed by an assassin, he can't speak the line.

There was a TODO here about not liking the conversation. The only real problem was that Leollyn said "I told you .." when he hadn't and that only one friend had died, not several.
2016-10-20 10:49:38 -05:00
Gregory A Lundberg
dbcd2e948d DM S04 Fix bug: Include advancements
The comments about Orcish Assassins apply to their advancements, as well.
2016-10-20 10:49:38 -05:00
Gregory A Lundberg
ab0c6e5335 DM S04 Fix bug: No defeat
Defeat when Leollyn dies, even if he advances.
2016-10-20 10:49:38 -05:00
Gregory A Lundberg
c38b5da9dc DM S04 Fix bug: Best bowman
Recall the best bowman. If we don't have any, recruit them. S03 ensured we had at least one.
2016-10-20 10:49:38 -05:00
Gregory A Lundberg
2d2ac10ba5 DM S03 Fix bug: Include advancements 2016-10-20 10:49:37 -05:00
Gregory A Lundberg
09e7006b1d DM S12 Fix bug: second wave
If the undead have not been spotted, Delfador does not know they're there, so cannot know about the second wave.
2016-10-20 10:49:37 -05:00
Gregory A Lundberg
39da9c8f9a DM Fix bug: Subsumed sides cannot move
In S13 we subsume the Loyalists and Mages.

In S19 we subsume Lionel and his troops.

These occur in the midst of battle. The units may be damaged, poisoned, etc. We do not want to change that.

However, since their turn follows ours, they cannot move. Reset their moves to maximum so we can use them (or move them out of harm's way) immediately.
2016-10-20 10:49:37 -05:00
Gregory A Lundberg
f86630273e DM Debug/Next_Level fix
Split off a victory event which ensures needful things happen on debug next_level.
2016-10-20 10:49:37 -05:00
Gregory A Lundberg
76b549987c DM Align teams and team names
Use 'allies' and 'enemies' consistently, throughout.

Delfador's team names are, in order: Mages, Loyalists, and Rebels. All Undead are a team; as are Bandits. Goblins, Orcs and Trolls are the Pillagers. The NPC Loyalists switch from allies to enemies, but remain Loyalists throughout.
2016-10-20 10:49:37 -05:00
Gregory A Lundberg
f8358bdfb3 DM Hide unneeded sides
S08 Side 3 is an implemention detail which the player does not need to see.

S08 After Delfador is struck and fading to black, hide all sides to enhance the player's impression Delfador has died. There are no sides left on the map, anyway.

S09 After the undead join Delfador, their side no longer exists.

S11 After Chantal joins Delfador, her side no longer exists.

S12 When the Loyalists and Mages join Delfador, their sides no long exist.

S17 After Ulrek joins Delfador, his side no longer exists.

S19 When Lionel joins Delfador, his side no longer exists.
2016-10-20 10:49:37 -05:00
Gregory A Lundberg
430d19569b DM Make heros
Consistently mark all non-leader units for whom death is a defeat condition.
2016-10-20 10:49:37 -05:00
Gregory A Lundberg
d1c6a4ab0c DM Fix bug: Kalenz takes over
Kalenz should take over a no_leader side, have his unit brought in as a [unit] tag, and his unit should not have side attributes.

This caused a number of errors in stderr, including dumping the full WML for the scene.
2016-10-20 10:49:37 -05:00
Gregory A Lundberg
8d3894a565 DM S21 Fix bug: Incomplete objectives 2016-10-20 10:49:37 -05:00
Gregory A Lundberg
cb1fd2ce2c DM S20 Delfador's been busy, too
Bump Delfador a level when he reappears to drag Eldred back to his father.
2016-10-20 10:49:37 -05:00
Gregory A Lundberg
68483ba984 DM S20 Since you've been away
It's been 26 years. Kalenz, Chantal and the other elves should be in perfect health, and have advanced a level from when last seen.
2016-10-20 10:49:36 -05:00
Gregory A Lundberg
6603003e62 DM S19 Fix bug: Kalenz returns in poor shape 2016-10-20 10:49:36 -05:00
Gregory A Lundberg
e59cb908e0 DM S19 Bring out your dead
Recall all Delfador's undead units so he is speaking to all of them when releasing them.
2016-10-20 10:49:36 -05:00
Gregory A Lundberg
afe5fc1ca2 DM S19 Kalenz is available
The [if] is meaningless. The death of Kalenz is a defeat; he will always be around on victory.
2016-10-20 10:49:36 -05:00
Gregory A Lundberg
7215b4403b DM S19 Fix bug: Defeat on undead death
Defeat should only occur when there are no more undead available to Delfador.
2016-10-20 10:49:36 -05:00