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

Implemented new property to block imps from taking objects #3541

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Shinthoras0815
Copy link
Contributor

Introduced a new Ignored_By_Imps property for objects, preventing imps from dragging them away from their location.

This change ensures that objects marked with this property are ignored by imps, preserving their intended location or purpose within the game. The implementation involved adding a new flag to the object structure and updating the imp behavior logic accordingly.

@@ -1 +1 @@
DEBUG=0
DEBUG=1
Copy link
Contributor

Choose a reason for hiding this comment

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

I assume this is an oversight?

@@ -320,7 +320,8 @@ long check_out_unclaimed_spells(struct Thing *spdigtng, long range)
break;
i = thing->next_of_class;
// Per-thing code
if (thing_is_spellbook(thing) || thing_is_special_box(thing))
if ((thing_is_spellbook(thing) || thing_is_special_box(thing)) &&
thing_can_be_picked_to_place_in_player_room_of_role(thing, spdigtng->owner, RoRoF_PowersStorage, TngFRPickF_Default))
Copy link
Contributor

Choose a reason for hiding this comment

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

What about crates? If mapmaker gives the flag to crate, it will still be able to be dragged on right? Altho I can't imagine a scenario where mapmaker would want a not draggable crate. 🤔

Another thing, what about gold pot or gold pile? Not technically draggable but the name IGNORED_BY_IMPS makes me think it could work if I were to set this flag on those objects, but it doesn't of course, the flag name is confusing.

So maybe a name change to make sense? Like NOT_DRAGGABLE for example. 🤔

Let me know what you think about it.

Copy link
Member

Choose a reason for hiding this comment

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

I suppose the (thing_is_spellbook(thing) || thing_is_special_box(thing)) is unneeded as thing_can_be_picked_to_place_in_player_room_of_role should cover it

Copy link
Member

Choose a reason for hiding this comment

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

What about crates? If mapmaker gives the flag to crate, it will still be able to be dragged on right? Altho I can't imagine a scenario where mapmaker would want a not draggable crate. 🤔

check_out_unclaimed_traps already uses thing_can_be_picked_to_place_in_player_room_of_role so should be ok

Copy link
Member

Choose a reason for hiding this comment

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

Another thing, what about gold pot or gold pile? Not technically draggable but the name IGNORED_BY_IMPS makes me think it could work if I were to set this flag on those objects, but it doesn't of course, the flag name is confusing.

looks like get_next_unclaimed_gold_thing_pickable_by_digger has it as a TODO but indeed it could also make use of thing_can_be_picked_to_place_in_player_room_of_role

Copy link
Contributor Author

Choose a reason for hiding this comment

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

as far as tested, this works with crates, spellbooks, and special boxes, also in possession mode

Copy link
Contributor Author

Choose a reason for hiding this comment

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

looks like get_next_unclaimed_gold_thing_pickable_by_digger has it as a TODO but indeed it could also make use of thing_can_be_picked_to_place_in_player_room_of_role

yes, I think mapmakers could appreciate having this option

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