about summary refs log tree commit diff stats
path: root/data/maps/daedalus
Commit message (Expand)AuthorAgeFilesLines
* Latch the control center color doorsStar Rauchenberger2025-10-231-0/+3
* Renamed Welcome Back Door locationStar Rauchenberger2025-10-021-0/+1
* Rename seasonings doors locationStar Rauchenberger2025-09-291-0/+1
* Added display names to portsStar Rauchenberger2025-09-2815-0/+16
* [Data] Annotate shuffleable portsStar Rauchenberger2025-09-2115-6/+31
* [Data] Rename SMILE locationsStar Rauchenberger2025-09-191-0/+5
* [Data] Renamed some doors with compass directionsStar Rauchenberger2025-09-193-30/+30
* [Data] Roof -> Orchestra RoomStar Rauchenberger2025-09-191-0/+6
* [Data] Daedalus - C Keyholder should be in East AreaStar Rauchenberger2025-09-161-1/+1
* [Data] Made Welcome Back middle door in daed vanillaStar Rauchenberger2025-09-121-2/+2
* [Client] Fixed The Great - Colorful EntranceStar Rauchenberger2025-09-121-1/+0
* [Data] Added missing connection in Outside HouseStar Rauchenberger2025-09-121-0/+5
* [Data] Added Theo Panels checkStar Rauchenberger2025-09-121-0/+10
* [Data] Hotel checkered door fixesStar Rauchenberger2025-09-111-40/+7
* [Data] Renamed Sticks and Stones locationStar Rauchenberger2025-09-111-0/+1
* [Data] Added Lime Hexes locationStar Rauchenberger2025-09-111-0/+11
* [Data] Fixed Purple NE Vestibules location nameStar Rauchenberger2025-09-111-1/+0
* [Data] Daed roof access to F KeyholderStar Rauchenberger2025-09-111-0/+6
* Added lavender cubes logicStar Rauchenberger2025-09-081-2/+6
* Added door groupsStar Rauchenberger2025-09-071-4/+0
* [Data] Renamed some locationsStar Rauchenberger2025-09-071-0/+3
* Added option for Daedalus roof access logicStar Rauchenberger2025-09-032-0/+316
* Added keyholder sanityStar Rauchenberger2025-09-025-0/+5
* [Data] Fixed Rainbow Rooms logicStar Rauchenberger2025-09-011-18/+19
* [Data] Some more double letters fixesStar Rauchenberger2025-09-012-1/+7
* [Data] Small tweaksStar Rauchenberger2025-08-312-2/+2
* [Data] Small tweaksStar Rauchenberger2025-08-302-0/+6
* Changed how door location names are formattedStar Rauchenberger2025-08-30152-154/+238
* [Data] Added logic for Tenacious Color PaintingStar Rauchenberger2025-08-302-1/+9
* [Data] Fix castle stairs (again)Star Rauchenberger2025-08-291-2/+2
* [Data] Replace move_paintings with receiversStar Rauchenberger2025-08-281-0/+3
* Couple of logic errorsStar Rauchenberger2025-08-281-1/+1
* Ok another Lime Pyramid connectionStar Rauchenberger2025-08-242-0/+25
* Connected up Lime PyramidStar Rauchenberger2025-08-242-0/+81
* Fixed typo in Blue Smiley Annex connectionStar Rauchenberger2025-08-241-1/+1
* Added daedalusStar Rauchenberger2025-08-24155-0/+9165
{ color: #008800; font-weight: bold } /* Keyword.Namespace */ .highlight .kp { color: #008800 } /* Keyword.Pseudo */ .highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
#include "orienting.h"
#include "game.h"
#include "components/orientable.h"
#include "components/ponderable.h"
#include "systems/animating.h"
#include "consts.h"
#include "muxer.h"

void OrientingSystem::tick(double)
{
  auto entities = game_.getEntityManager().getEntitiesWithComponents<
    OrientableComponent,
    PonderableComponent>();

  for (id_type entity : entities)
  {
    auto& orientable = game_.getEntityManager().
      getComponent<OrientableComponent>(entity);

    auto& ponderable = game_.getEntityManager().
      getComponent<PonderableComponent>(entity);

    switch (orientable.getWalkState())
    {
      case OrientableComponent::WalkState::still:
      {
        ponderable.setVelocityX(0);

        break;
      }

      case OrientableComponent::WalkState::left:
      {
        ponderable.setVelocityX(-WALK_SPEED);

        break;
      }

      case OrientableComponent::WalkState::right:
      {
        ponderable.setVelocityX(WALK_SPEED);

        break;
      }
    }

    if (orientable.isJumping() && (ponderable.getVelocityY() > 0))
    {
      orientable.setJumping(false);
    }
  }
}

void OrientingSystem::moveLeft(id_type entity)
{
  auto& ponderable = game_.getEntityManager().
    getComponent<PonderableComponent>(entity);

  auto& orientable = game_.getEntityManager().
    getComponent<OrientableComponent>(entity);

  orientable.setFacingRight(false);
  orientable.setWalkState(OrientableComponent::WalkState::left);

  auto& animating = game_.getSystemManager().getSystem<AnimatingSystem>();
  if (ponderable.isGrounded())
  {
    animating.startAnimation(entity, "walkingLeft");
  } else {
    animating.startAnimation(entity, "stillLeft");
  }
}

void OrientingSystem::moveRight(id_type entity)
{
  auto& ponderable = game_.getEntityManager().
    getComponent<PonderableComponent>(entity);

  auto& orientable = game_.getEntityManager().
    getComponent<OrientableComponent>(entity);

  orientable.setFacingRight(true);
  orientable.setWalkState(OrientableComponent::WalkState::right);

  auto& animating = game_.getSystemManager().getSystem<AnimatingSystem>();
  if (ponderable.isGrounded())
  {
    animating.startAnimation(entity, "walkingRight");
  } else {
    animating.startAnimation(entity, "stillRight");
  }
}

void OrientingSystem::stopWalking(id_type entity)
{
  auto& orientable = game_.getEntityManager().
    getComponent<OrientableComponent>(entity);

  orientable.setWalkState(OrientableComponent::WalkState::still);

  auto& animating = game_.getSystemManager().getSystem<AnimatingSystem>();

  if (orientable.isFacingRight())
  {
    animating.startAnimation(entity, "stillRight");
  } else {
    animating.startAnimation(entity, "stillLeft");
  }
}

void OrientingSystem::jump(id_type entity)
{
  auto& ponderable = game_.getEntityManager().
    getComponent<PonderableComponent>(entity);

  if (ponderable.isGrounded())
  {
    auto& orientable = game_.getEntityManager().
      getComponent<OrientableComponent>(entity);

    orientable.setJumping(true);

    playSound("res/Randomize87.wav", 0.25);

    ponderable.setVelocityY(JUMP_VELOCITY);
    ponderable.setAccelY(JUMP_GRAVITY);

    auto& animating = game_.getSystemManager().getSystem<AnimatingSystem>();
    if (orientable.isFacingRight())
    {
      animating.startAnimation(entity, "stillRight");
    } else {
      animating.startAnimation(entity, "stillLeft");
    }
  }
}

void OrientingSystem::stopJumping(id_type entity)
{
  auto& orientable = game_.getEntityManager().
    getComponent<OrientableComponent>(entity);

  if (orientable.isJumping())
  {
    orientable.setJumping(false);

    auto& ponderable = game_.getEntityManager().
      getComponent<PonderableComponent>(entity);

    ponderable.setAccelY(NORMAL_GRAVITY);
  }
}

void OrientingSystem::land(id_type entity)
{
  auto& orientable = game_.getEntityManager().
    getComponent<OrientableComponent>(entity);

  auto& animating = game_.getSystemManager().getSystem<AnimatingSystem>();

  switch (orientable.getWalkState())
  {
    case OrientableComponent::WalkState::still:
    {
      if (orientable.isFacingRight())
      {
        animating.startAnimation(entity, "stillRight");
      } else {
        animating.startAnimation(entity, "stillLeft");
      }

      break;
    }

    case OrientableComponent::WalkState::left:
    {
      animating.startAnimation(entity, "walkingLeft");

      break;
    }

    case OrientableComponent::WalkState::right:
    {
      animating.startAnimation(entity, "walkingRight");

      break;
    }
  }
}

void OrientingSystem::startFalling(id_type entity)
{
  auto& orientable = game_.getEntityManager().
    getComponent<OrientableComponent>(entity);

  auto& animating = game_.getSystemManager().getSystem<AnimatingSystem>();

  if (orientable.isFacingRight())
  {
    animating.startAnimation(entity, "stillRight");
  } else {
    animating.startAnimation(entity, "stillLeft");
  }
}

void OrientingSystem::drop(id_type entity)
{
  auto& orientable = game_.getEntityManager().
    getComponent<OrientableComponent>(entity);

  auto& ponderable = game_.getEntityManager().
    getComponent<PonderableComponent>(entity);

  if (ponderable.isGrounded()
    && (orientable.getDropState() == OrientableComponent::DropState::none))
  {
    orientable.setDropState(OrientableComponent::DropState::ready);
  }
}

void OrientingSystem::stopDropping(id_type entity)
{
  auto& orientable = game_.getEntityManager().
    getComponent<OrientableComponent>(entity);

  if (orientable.getDropState() == OrientableComponent::DropState::ready)
  {
    orientable.setDropState(OrientableComponent::DropState::none);
  }
}