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

Root Sapling (a.k.a. Corrupted Mole) #2698

Merged
merged 58 commits into from
Mar 29, 2024
Merged

Conversation

Rusty-Box
Copy link
Member

@Rusty-Box Rusty-Box commented Dec 11, 2023

Note: The sprites of the Root Sapling itself are still WIP and mostly serve to begin coding!

Behavior:
Root Sapling is permanently exposed, unlike Mole, and does not throw rocks. Instead Root Sapling spawns small roots pointing upwards (like Ghost Tree) underneath the player every couple seconds - one at a time. The root attack will only stop until the player either leaves its attack range or kills it by jumping on its head/core. It's attack radius would be quite large - big enough that it can roughly attacks you as long as it is on screen. 20 tiles might be enough, maybe.

Root Attack:
Underneath the player's last position, a small hill spawns (with partilces popping up to help visualizing where/when it spawned and a second after the root pokes out, retracting shortly after - then despawning. Another root may appear with a 2 second cooldown.

This enemy will (hopefully) give players a point of reference when eventually facing the Ghost Tree, as the current plan for how to damage it will be shared with Root Sapling - hitting its core by jumping on it!

Scripted Concept Video:

scripted_root_sapling_concept.mp4

TODO

  • Coding (need help with that)
  • Finalize Root Sampling sprites
  • Sprites for Root Attack
  • Particles for Hill
  • Bug fixing

Note: The sprites of the Root Sapling itself are still WIP and mostly serve to begin coding!
@Rusty-Box Rusty-Box added type:idea type:feature category:code category:design status:needs-work In progress, but no one is currently working on it (New volunteers welcome) labels Dec 11, 2023
@Rusty-Box Rusty-Box added this to the 0.7.0 milestone Dec 11, 2023
@FILIPOKonGithup

This comment has been minimized.

@Rusty-Box Rusty-Box added status:in-progress Progress has been done, but more is intended be done and removed status:needs-work In progress, but no one is currently working on it (New volunteers welcome) type:idea labels Dec 20, 2023
@FILIPOKonGithup

This comment was marked as off-topic.

src/badguy/root.cpp Outdated Show resolved Hide resolved
src/badguy/root.cpp Outdated Show resolved Hide resolved
src/badguy/root.cpp Outdated Show resolved Hide resolved
src/badguy/root.cpp Outdated Show resolved Hide resolved
src/badguy/root_sapling.cpp Outdated Show resolved Hide resolved
src/badguy/root_sapling.cpp Outdated Show resolved Hide resolved
src/badguy/root.hpp Outdated Show resolved Hide resolved
Copy link
Member

@tobbi tobbi left a comment

Choose a reason for hiding this comment

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

I just tested this and it works fine.

Also, increase rock size + one more sprite variant
(needs code adjustments!)
@Rusty-Box
Copy link
Member Author

@MatusGuy I also added the slightly improved Mole graphics and one extra sprite variant for its rock that it throws. Could you code it to included that as well. I put in a single sprite file divided into three actions.

Copy link
Member

@Vankata453 Vankata453 left a comment

Choose a reason for hiding this comment

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

At the moment, it seems to work properly and codewise it also looks good.

However, me and Rusty believe that in multiplayer, the root sapling should also be able to damage multiple players at the same time, instead of the nearest one, one at a time.

void construct(float delay = -1, bool play_sound = true);

enum State { STATE_HATCHING, STATE_APPEARING, STATE_RETREATING };
Copy link
Member

Choose a reason for hiding this comment

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

I thought types came first

Copy link
Member

Choose a reason for hiding this comment

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

Functions first, then enumerators and variables, so everything is fully organized.

@@ -158,9 +158,9 @@ RootSapling::summon_root()
(*axis) = player->get_bbox().get_bottom() + 1;

bool should_summon = false;
for (TileMap* map : Sector::get().get_solid_tilemaps())
for (TileMap* tilemap : Sector::get().get_solid_tilemaps())
Copy link
Member

Choose a reason for hiding this comment

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

what!!!

Copy link
Member

Choose a reason for hiding this comment

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

Just a more verbose variable name.

@@ -124,8 +124,7 @@ class Sprite final
Blend get_blend() const;

bool has_action (const std::string& name) const { return (m_data.get_action(name) != nullptr); }

std::size_t get_actions_count() { return m_data.actions.size(); }
size_t get_actions_count() const { return m_data.actions.size(); }
Copy link
Member

Choose a reason for hiding this comment

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

what

Copy link
Member

Choose a reason for hiding this comment

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

Nowhere does the code specify std:: for size_t, since there is no need to. It's a nitpick but I was editing the code anyways, so...

Copy link
Member

@Vankata453 Vankata453 left a comment

Choose a reason for hiding this comment

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

When playing with 2 players, if the first one is dead and hasn't respawned, the second never gets detected by the root sapling.

Copy link
Member

@Vankata453 Vankata453 left a comment

Choose a reason for hiding this comment

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

There was a lot of leftover usage of return, where continue should be used instead, because of the newly added loop.

Seems to work great now!

@weluvgoatz weluvgoatz merged commit c2cc19b into SuperTux:master Mar 29, 2024
33 checks passed
@mrkubax10 mrkubax10 removed the status:needs-review Work needs to be reviewed by other people label Jun 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

8 participants