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

Merge TrapStats & ManfctrConfig with TrapConfigStats and ManfctrConfig with DoorConfigStats #3652

Merged
merged 6 commits into from
Nov 13, 2024

Conversation

walt253
Copy link
Contributor

@walt253 walt253 commented Nov 8, 2024

Plus reordered stuff around on trapdoor.cfg, added comments.

Also reordered trapdoor_door_commands on config_trapdoor.c - let me know if you wish to see this reverted but if you like it I might do the same thing later for trapdoor_trap_commands!

If possible I would like to see #3635 merged before this PR, for convenience, but its whatever I will have to fix conflicts either way.

@@ -3268,7 +3270,8 @@ long task_sell_traps_and_doors(struct Computer2 *comp, struct ComputerTask *ctas
ERRORLOG("Internal error - invalid door model %d in slot %d",(int)model,(int)i);
break;
}
if (dungeon->mnfct_info.door_amount_placeable[model] > 0)
doorst = get_door_model_stats(model);
if ((dungeon->mnfct_info.door_amount_placeable[model] > 0) && (doorst->unsellable == 0))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added a check for unsellable to stop computer selling the unsellable. Let me know if you want to see this reverted.

@@ -3338,13 +3341,14 @@ long task_sell_traps_and_doors(struct Computer2 *comp, struct ComputerTask *ctas
{
struct Thing *doortng;
doortng = get_random_door_of_model_owned_by_and_locked(model, dungeon->owner, false);
if (!thing_is_invalid(doortng)) {
doorst = get_door_model_stats(doortng->model);
if ((!thing_is_invalid(doortng)) && (doorst->unsellable == 0)) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Same thing, check for unsellable added here.

@@ -3374,13 +3378,15 @@ long task_sell_traps_and_doors(struct Computer2 *comp, struct ComputerTask *ctas
{
struct Thing *traptng;
traptng = get_random_trap_of_model_owned_by_and_armed(model, dungeon->owner, true);
if (!thing_is_invalid(traptng)) {
trapst = get_trap_model_stats(traptng->model);
if ((!thing_is_invalid(traptng)) && (trapst->unsellable == 0)) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also unsellable here.

src/player_comptask.c Outdated Show resolved Hide resolved
{"PROPERTIES", 13},
{"SELLINGVALUE", 14},
{"UNSELLABLE", 15},
{"PLACESOUND", 16},
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the reorder I'm talking about, so it matches the order on trapdoor.cfg - It's pointless tho so it can be reverted if you don't like it. And of course for next addition if any, new stuff should still be added at end of list.

Copy link
Member

Choose a reason for hiding this comment

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

I don't mind a reorder, if it still everything works.

@walt253 walt253 marked this pull request as ready for review November 8, 2024 20:27
src/player_instances.c Outdated Show resolved Hide resolved
@PieterVdc
Copy link
Member

don't notice anything else, so to me code looks fine

destroy_door(thing);
if (is_my_player_number(plyr_idx))
play_non_3d_sample(115);
{
play_non_3d_sample(115); // TODO config make this sound configurable?
Copy link
Member

Choose a reason for hiding this comment

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

I don't think it is a problem for the selling sound to be hardcoded. This is not a door specific thing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think it is a problem for the selling sound to be hardcoded. This is not a door specific thing.

I meant to make it configurable for everything, so doors/traps/rooms can have a different selling sound?

@Loobinex Loobinex merged commit 628de77 into dkfans:master Nov 13, 2024
@walt253 walt253 deleted the MergeTrapStatsStruct branch November 13, 2024 09:27
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