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

Add validation functions for creature self-buff instances #3527

Merged
merged 14 commits into from
Oct 12, 2024

Conversation

Linvail
Copy link
Contributor

@Linvail Linvail commented Oct 6, 2024

This adds validation functions for creature self-buff instances.

  • Fix Speed is not cast when attacking an object or door.
  • Fix Ranged Rebound/Armour being cast when not in combat.

Type: Bug Fix

* Fix Speed is not cast when attacking object/door.
* Fix Wind is not working.
* Fix Ranged Rebound/Armour being casted when not in combat.

Type: Bug Fix
@Linvail Linvail requested a review from Loobinex October 6, 2024 16:29
@Linvail Linvail self-assigned this Oct 6, 2024
@Linvail
Copy link
Contributor Author

Linvail commented Oct 6, 2024

This incorporates some ideas in PR #3452.
This fixes issue #3445 but conflicts with PR #3446.
This fixes the broken Wind spell caused by PR #3463.

config/fxdata/creature.cfg Outdated Show resolved Hide resolved
src/creature_states_combt.c Outdated Show resolved Hide resolved
This adds more properties for creature instance.
* Fix Speed is not cast when attacking object/door.
* Fix Ranged Rebound/Armour being cast when not in combat.

Type: Bug Fix
@Linvail Linvail marked this pull request as draft October 7, 2024 03:20
@Linvail
Copy link
Contributor Author

Linvail commented Oct 7, 2024

I will try to add more validation functions.

@Linvail Linvail changed the title Fix some bugs of spell Add validation functions for creature self-buff instances Oct 8, 2024
config/fxdata/creature.cfg Outdated Show resolved Hide resolved
src/config_creature.c Outdated Show resolved Hide resolved
src/creature_instances.h Outdated Show resolved Hide resolved
src/creature_states_combt.c Show resolved Hide resolved
@Linvail Linvail marked this pull request as ready for review October 9, 2024 17:01
@Linvail
Copy link
Contributor Author

Linvail commented Oct 9, 2024

This PR is ready for review and test.

@walt253
Copy link
Contributor

walt253 commented Oct 9, 2024

How does it work?

; Functions used validate the source of the spell. Could have two parameters.
ValidateSourceFunc = validate_source_generic 0 0
; Functions used validate the the target of the spell. Could have two parameters.
ValidateTargetFunc = validate_target_generic 0 0
; Functions used search targets of the spell. Could have two parameters.
SearchTargetsFunc = search_target_generic 0 0

What are those extra parameters for? Do you have an example?

Are they combinable?

@Linvail
Copy link
Contributor Author

Linvail commented Oct 10, 2024

How does it work?

; Functions used validate the source of the spell. Could have two parameters.
ValidateSourceFunc = validate_source_generic 0 0
; Functions used validate the the target of the spell. Could have two parameters.
ValidateTargetFunc = validate_target_generic 0 0
; Functions used search targets of the spell. Could have two parameters.
SearchTargetsFunc = search_target_generic 0 0

What are those extra parameters for? Do you have an example?

Are they combinable?

I will add more explanations to them. They don't like combinable at all. What makes you think they might be combinable?

@walt253
Copy link
Contributor

walt253 commented Oct 10, 2024

How does it work?

; Functions used validate the source of the spell. Could have two parameters.
ValidateSourceFunc = validate_source_generic 0 0
; Functions used validate the the target of the spell. Could have two parameters.
ValidateTargetFunc = validate_target_generic 0 0
; Functions used search targets of the spell. Could have two parameters.
SearchTargetsFunc = search_target_generic 0 0

What are those extra parameters for? Do you have an example?
Are they combinable?

I will add more explanations to them. They don't like combinable at all. What makes you think they might be combinable?

Oh I tought maybe the extra parameters could be used like that:

SearchTargetsFunc = search_target_generic search_target_generic search_target_generic

Obviously not with same generic function.

But it's fine if it's not combinable.

I'm looking forward the explanations later. 👍

ValidateTargetFunc, and SearchTargetsFunc in creature.cfg
@Linvail
Copy link
Contributor Author

Linvail commented Oct 10, 2024

I added explanations for ValidateSourceFunc, ValidateTargetFunc, and SearchTargetsFunc in creature.cfg.
The two parameters are reserved for future usage. I have plans for them.

Copy link
Member

@Loobinex Loobinex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made some small comments, but in general I think this is a nice change.

src/creature_instances.c Outdated Show resolved Hide resolved
src/config_creature.c Outdated Show resolved Hide resolved
src/bflib_basics.h Show resolved Hide resolved
config/fxdata/creature.cfg Outdated Show resolved Hide resolved
config/fxdata/creature.cfg Outdated Show resolved Hide resolved
config/fxdata/creature.cfg Outdated Show resolved Hide resolved
@Loobinex Loobinex merged commit 97902cd into dkfans:master Oct 12, 2024
@Linvail Linvail deleted the check-if-ranged-buff-needed branch October 12, 2024 08:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants