Skip to content

Commit

Permalink
Pikmin no longer try to circle non-enemies before attacking.
Browse files Browse the repository at this point in the history
- Circling is a way to make combat more engaging and make the Pikmin more slippery against the enemy. It makes no sense against a stationary obstacle.
- Plus this was resulting in Rock Pikmin going to the other side of bridges and bouncing in the wrong direction.
  • Loading branch information
Espyo committed Jan 8, 2025
1 parent a82e035 commit 3242bea
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
8 changes: 7 additions & 1 deletion source/documents/todo.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,17 @@

Current tasks (tasks being worked on, but not yet committed)
Add an "outward angle" option for particles
As a player I don't know which side of a fragment bridge the Pikmin will deliver to
Status page numbers are hard to read
Rock Pikmin thrown at a Pellet Posy should go to the Pellet Posy when they wake up
When a mob is on a fade sector and moving towards the void, darken it if the area has no background, brighten it otherwise


Next tasks (roughly sorted most important first)
--- To fix ---

Two nectars touching each other will "bloop" constantly
Leader damage sparks and group move arrows keep animating while the game is paused
Some fader sectors are weirdly lighter, but only in the area editor, and without preview mode

--- 0.26 ---
Add a "Play" or "Make" label in the corresponding main menu sub-menus
Expand Down
10 changes: 7 additions & 3 deletions source/source/mob_fsms/pikmin_fsm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2440,6 +2440,10 @@ void pikmin_fsm::decide_attack(mob* m, void* info1, void* info2) {
pik_ptr->stop_chasing();
pik_ptr->stop_circling();

bool can_circle =
pik_ptr->fsm.cur_state->id != PIKMIN_STATE_CIRCLING_OPPONENT &&
m->focused_mob->type->category->id == MOB_CATEGORY_ENEMIES;

switch(pik_ptr->pik_type->attack_method) {
case PIKMIN_ATTACK_LATCH: {
//This Pikmin latches on to things and/or smacks with its top.
Expand All @@ -2465,7 +2469,7 @@ void pikmin_fsm::decide_attack(mob* m, void* info1, void* info2) {
if(
randomf(0.0f, 1.0f) <=
PIKMIN::CIRCLE_OPPONENT_CHANCE_GROUNDED &&
pik_ptr->fsm.cur_state->id != PIKMIN_STATE_CIRCLING_OPPONENT
can_circle
) {
//Circle around the opponent a bit before smacking.
pik_ptr->fsm.set_state(PIKMIN_STATE_CIRCLING_OPPONENT);
Expand All @@ -2480,7 +2484,7 @@ void pikmin_fsm::decide_attack(mob* m, void* info1, void* info2) {
if(
randomf(0, 1) <=
PIKMIN::CIRCLE_OPPONENT_CHANCE_PRE_LATCH &&
pik_ptr->fsm.cur_state->id != PIKMIN_STATE_CIRCLING_OPPONENT
can_circle
) {
//Circle around the opponent a bit before latching.
pik_ptr->fsm.set_state(PIKMIN_STATE_CIRCLING_OPPONENT);
Expand All @@ -2501,7 +2505,7 @@ void pikmin_fsm::decide_attack(mob* m, void* info1, void* info2) {
if(
randomf(0, 1) <=
PIKMIN::CIRCLE_OPPONENT_CHANCE_GROUNDED &&
pik_ptr->fsm.cur_state->id != PIKMIN_STATE_CIRCLING_OPPONENT
can_circle
) {
//Circle around the opponent a bit before lunging.
pik_ptr->fsm.set_state(PIKMIN_STATE_CIRCLING_OPPONENT);
Expand Down

0 comments on commit 3242bea

Please sign in to comment.