Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

attack prediction wrong for some weaponspecials with filters #1836

Open
gfgtdf opened this issue Jul 13, 2017 · 2 comments
Open

attack prediction wrong for some weaponspecials with filters #1836

gfgtdf opened this issue Jul 13, 2017 · 2 comments
Labels
Bug Issues involving unexpected behavior. Lua API Issues with the Lua engine and API. Units Issues that involve unit definitions or their implementation in the engine. WFL Issues involving the Wesnoth Formula Language engine and APIs.

Comments

@gfgtdf
Copy link
Contributor

gfgtdf commented Jul 13, 2017

If a unit has an attack like tihs

[attack]
	damage=10
	number=2
	range="melee"
	type="impact"
	[specials]
		[damage]
			add=4
			[filter_self]
				formula = "hitpoints > 50"
			[/filter_self]
		[/damage]
	[/specials]
[/attack]

(lets assume tha unti has current 51 hp) the damage prediction code will assume that every attack does 14 damagebut during the actual fight all strikes that were made after the unit has <50 hp left do just 10 damage. Tested on wesnoth 1.13.8 release.

@CelticMinstrel CelticMinstrel added Bug Issues involving unexpected behavior. Units Issues that involve unit definitions or their implementation in the engine. WFL Issues involving the Wesnoth Formula Language engine and APIs. labels Jul 14, 2017
@CelticMinstrel
Copy link
Member

Hmm, this seems kind of tricky. The obvious fix would be to save the unit's current hit points but then set it to various projected values as the attack prediction progresses, but I feel like there has to be a better way than that...

@CelticMinstrel CelticMinstrel added the Lua API Issues with the Lua engine and API. label Jul 14, 2017
@CelticMinstrel
Copy link
Member

(Also adding the Lua label because I assume this would also affect filters using lua_function.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Issues involving unexpected behavior. Lua API Issues with the Lua engine and API. Units Issues that involve unit definitions or their implementation in the engine. WFL Issues involving the Wesnoth Formula Language engine and APIs.
Projects
None yet
Development

No branches or pull requests

2 participants