-
-
Notifications
You must be signed in to change notification settings - Fork 493
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
Conversation
Note: The sprites of the Root Sapling itself are still WIP and mostly serve to begin coding!
This comment has been minimized.
This comment has been minimized.
…into root-sapling
This comment was marked as off-topic.
This comment was marked as off-topic.
Please let this be the last bug
There was a problem hiding this 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!)
@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. |
There was a problem hiding this 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 }; |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
src/badguy/root_sapling.cpp
Outdated
@@ -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()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what!!!
There was a problem hiding this comment.
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(); } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what
There was a problem hiding this comment.
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...
There was a problem hiding this 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.
There was a problem hiding this 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!
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