Fixed Kraken battle. I think. Made it so you do not shoot projectiles or squids when struggling with Kraken.
This commit is contained in:
@@ -30,6 +30,8 @@
|
|||||||
#include "Game/EStickyAttachedToPad.h"
|
#include "Game/EStickyAttachedToPad.h"
|
||||||
#include "Game/EInkBlaster.h"
|
#include "Game/EInkBlaster.h"
|
||||||
#include "Game/EInkBlasterOver.h"
|
#include "Game/EInkBlasterOver.h"
|
||||||
|
#include "Game/EKrakenAttack.h"
|
||||||
|
#include "Game/EKrakenAttackEnd.h"
|
||||||
#include "Game/EStageCleared.h"
|
#include "Game/EStageCleared.h"
|
||||||
#include "Game/EArrivedAtNewStage.h"
|
#include "Game/EArrivedAtNewStage.h"
|
||||||
#include "Game/EGameOver.h"
|
#include "Game/EGameOver.h"
|
||||||
@@ -109,6 +111,8 @@ private:
|
|||||||
bool m_InkBlaster = false;
|
bool m_InkBlaster = false;
|
||||||
bool m_InkAttached = false;
|
bool m_InkAttached = false;
|
||||||
bool m_InkBlockedWaiting = false;
|
bool m_InkBlockedWaiting = false;
|
||||||
|
bool m_KrakenAttack = false;
|
||||||
|
double m_KrakenCharge = 0;
|
||||||
bool m_Restarting = false;
|
bool m_Restarting = false;
|
||||||
int m_StickyCounter = 3;
|
int m_StickyCounter = 3;
|
||||||
bool m_GodMode = false;
|
bool m_GodMode = false;
|
||||||
@@ -130,6 +134,8 @@ private:
|
|||||||
dd::EventRelay<BallSystem, dd::Events::StickyPad> m_EStickyPad;
|
dd::EventRelay<BallSystem, dd::Events::StickyPad> m_EStickyPad;
|
||||||
dd::EventRelay<BallSystem, dd::Events::InkBlaster> m_EInkBlaster;
|
dd::EventRelay<BallSystem, dd::Events::InkBlaster> m_EInkBlaster;
|
||||||
dd::EventRelay<BallSystem, dd::Events::InkBlasterOver> m_EInkBlasterOver;
|
dd::EventRelay<BallSystem, dd::Events::InkBlasterOver> m_EInkBlasterOver;
|
||||||
|
dd::EventRelay<BallSystem, dd::Events::KrakenAttack> m_EKrakenAttack;
|
||||||
|
dd::EventRelay<BallSystem, dd::Events::KrakenAttackEnd> m_EKrakenAttackEnd;
|
||||||
dd::EventRelay<BallSystem, dd::Events::Pause> m_EPause;
|
dd::EventRelay<BallSystem, dd::Events::Pause> m_EPause;
|
||||||
dd::EventRelay<BallSystem, dd::Events::Resume> m_EResume;
|
dd::EventRelay<BallSystem, dd::Events::Resume> m_EResume;
|
||||||
dd::EventRelay<BallSystem, dd::Events::Contact> m_Contact;
|
dd::EventRelay<BallSystem, dd::Events::Contact> m_Contact;
|
||||||
@@ -145,6 +151,8 @@ private:
|
|||||||
bool OnStickyPad(const dd::Events::StickyPad &event);
|
bool OnStickyPad(const dd::Events::StickyPad &event);
|
||||||
bool OnInkBlaster(const dd::Events::InkBlaster &event);
|
bool OnInkBlaster(const dd::Events::InkBlaster &event);
|
||||||
bool OnInkBlasterOver(const dd::Events::InkBlasterOver &event);
|
bool OnInkBlasterOver(const dd::Events::InkBlasterOver &event);
|
||||||
|
bool OnKrakenAttack(const dd::Events::KrakenAttack &event);
|
||||||
|
bool OnKrakenAttackEnd(const dd::Events::KrakenAttackEnd &event);
|
||||||
bool OnPause(const dd::Events::Pause &event);
|
bool OnPause(const dd::Events::Pause &event);
|
||||||
bool OnResume(const dd::Events::Resume &event);
|
bool OnResume(const dd::Events::Resume &event);
|
||||||
bool OnActionButton(const dd::Events::ActionButton &event);
|
bool OnActionButton(const dd::Events::ActionButton &event);
|
||||||
|
|||||||
@@ -0,0 +1,25 @@
|
|||||||
|
//
|
||||||
|
// Created by Adniklastrator on 2015-10-21.
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef DAYDREAM_EKRAKENATTACKEND_H
|
||||||
|
#define DAYDREAM_EKRAKENATTACKEND_H
|
||||||
|
|
||||||
|
#include "Core/EventBroker.h"
|
||||||
|
|
||||||
|
namespace dd
|
||||||
|
{
|
||||||
|
|
||||||
|
namespace Events
|
||||||
|
{
|
||||||
|
|
||||||
|
struct KrakenAttackEnd : Event
|
||||||
|
{
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif //DAYDREAM_EKRAKENATTACKEND_H
|
||||||
@@ -21,6 +21,7 @@
|
|||||||
#include "Physics/ECreateParticleSequence.h"
|
#include "Physics/ECreateParticleSequence.h"
|
||||||
#include "Game/EPause.h"
|
#include "Game/EPause.h"
|
||||||
#include "Game/EResume.h"
|
#include "Game/EResume.h"
|
||||||
|
#include "Game/EComboEvent.h"
|
||||||
#include "Game/EKrakenAppear.h"
|
#include "Game/EKrakenAppear.h"
|
||||||
#include "Game/EKrakenAttack.h"
|
#include "Game/EKrakenAttack.h"
|
||||||
#include "Game/EKrakenHit.h"
|
#include "Game/EKrakenHit.h"
|
||||||
|
|||||||
@@ -143,7 +143,7 @@ private:
|
|||||||
bool m_Initialized = false;
|
bool m_Initialized = false;
|
||||||
bool m_Pause = false;
|
bool m_Pause = false;
|
||||||
int m_LooseBricks = 0;
|
int m_LooseBricks = 0;
|
||||||
int m_CurrentCluster = 1;
|
int m_CurrentCluster = 0;
|
||||||
int m_CurrentLevel = 1;
|
int m_CurrentLevel = 1;
|
||||||
int m_MultiBalls = 0;
|
int m_MultiBalls = 0;
|
||||||
int m_PowerUps = 0;
|
int m_PowerUps = 0;
|
||||||
|
|||||||
@@ -43,6 +43,7 @@
|
|||||||
#include "Game/EStickyAttachedToPad.h"
|
#include "Game/EStickyAttachedToPad.h"
|
||||||
#include "Game/EInkBlaster.h"
|
#include "Game/EInkBlaster.h"
|
||||||
#include "Game/EKrakenAttack.h"
|
#include "Game/EKrakenAttack.h"
|
||||||
|
#include "Game/EKrakenAttackEnd.h"
|
||||||
#include "Game/EPowerUpTaken.h"
|
#include "Game/EPowerUpTaken.h"
|
||||||
#include "Game/EStageCleared.h"
|
#include "Game/EStageCleared.h"
|
||||||
#include "Game/EPause.h"
|
#include "Game/EPause.h"
|
||||||
@@ -123,6 +124,7 @@ private:
|
|||||||
dd::EventRelay<PadSystem, dd::Events::Pause> m_EPause;
|
dd::EventRelay<PadSystem, dd::Events::Pause> m_EPause;
|
||||||
dd::EventRelay<PadSystem, dd::Events::Resume> m_EResume;
|
dd::EventRelay<PadSystem, dd::Events::Resume> m_EResume;
|
||||||
dd::EventRelay<PadSystem, dd::Events::KrakenAttack> m_EKrakenAttack;
|
dd::EventRelay<PadSystem, dd::Events::KrakenAttack> m_EKrakenAttack;
|
||||||
|
dd::EventRelay<PadSystem, dd::Events::KrakenAttackEnd> m_EKrakenAttackEnd;
|
||||||
dd::EventRelay<PadSystem, dd::Events::StickyPad> m_EStickyPad;
|
dd::EventRelay<PadSystem, dd::Events::StickyPad> m_EStickyPad;
|
||||||
dd::EventRelay<PadSystem, dd::Events::StickyAttachedToPad> m_EStickyAttachedToPad;
|
dd::EventRelay<PadSystem, dd::Events::StickyAttachedToPad> m_EStickyAttachedToPad;
|
||||||
dd::EventRelay<PadSystem, dd::Events::ActionButton> m_EActionButton;
|
dd::EventRelay<PadSystem, dd::Events::ActionButton> m_EActionButton;
|
||||||
@@ -140,6 +142,7 @@ private:
|
|||||||
bool OnPause(const dd::Events::Pause &event);
|
bool OnPause(const dd::Events::Pause &event);
|
||||||
bool OnResume(const dd::Events::Resume &event);
|
bool OnResume(const dd::Events::Resume &event);
|
||||||
bool OnKrakenAttack(const dd::Events::KrakenAttack &event);
|
bool OnKrakenAttack(const dd::Events::KrakenAttack &event);
|
||||||
|
bool OnKrakenAttackEnd(const dd::Events::KrakenAttackEnd &event);
|
||||||
bool OnStickyPad(const dd::Events::StickyPad &event);
|
bool OnStickyPad(const dd::Events::StickyPad &event);
|
||||||
bool OnStickyAttachedToPad(const dd::Events::StickyAttachedToPad &event);
|
bool OnStickyAttachedToPad(const dd::Events::StickyAttachedToPad &event);
|
||||||
bool OnActionButton(const dd::Events::ActionButton &event);
|
bool OnActionButton(const dd::Events::ActionButton &event);
|
||||||
|
|||||||
@@ -19,6 +19,8 @@
|
|||||||
#include "Game/EResume.h"
|
#include "Game/EResume.h"
|
||||||
#include "Game/EInkBlaster.h"
|
#include "Game/EInkBlaster.h"
|
||||||
#include "Game/EInkBlasterOver.h"
|
#include "Game/EInkBlasterOver.h"
|
||||||
|
#include "Game/EKrakenAttack.h"
|
||||||
|
#include "Game/EKrakenAttackEnd.h"
|
||||||
#include "Game/EActionButton.h"
|
#include "Game/EActionButton.h"
|
||||||
#include "Game/EHitPad.h"
|
#include "Game/EHitPad.h"
|
||||||
#include "Game/CProjectile.h"
|
#include "Game/CProjectile.h"
|
||||||
@@ -52,6 +54,7 @@ private:
|
|||||||
bool m_Pause = false;
|
bool m_Pause = false;
|
||||||
bool m_InkBlaster = false;
|
bool m_InkBlaster = false;
|
||||||
bool m_SquidLoaded = false;
|
bool m_SquidLoaded = false;
|
||||||
|
bool m_KrakenAttack = false;
|
||||||
int m_Shots = 0;
|
int m_Shots = 0;
|
||||||
float m_InkBlasterSpeed = 5;
|
float m_InkBlasterSpeed = 5;
|
||||||
EntityID m_InkBlastTemplate;
|
EntityID m_InkBlastTemplate;
|
||||||
@@ -61,6 +64,8 @@ private:
|
|||||||
dd::EventRelay<ProjectileSystem, dd::Events::Pause> m_EPause;
|
dd::EventRelay<ProjectileSystem, dd::Events::Pause> m_EPause;
|
||||||
dd::EventRelay<ProjectileSystem, dd::Events::Resume> m_EResume;
|
dd::EventRelay<ProjectileSystem, dd::Events::Resume> m_EResume;
|
||||||
dd::EventRelay<ProjectileSystem, dd::Events::InkBlaster> m_EInkBlaster;
|
dd::EventRelay<ProjectileSystem, dd::Events::InkBlaster> m_EInkBlaster;
|
||||||
|
dd::EventRelay<ProjectileSystem, dd::Events::KrakenAttack> m_EKrakenAttack;
|
||||||
|
dd::EventRelay<ProjectileSystem, dd::Events::KrakenAttackEnd> m_EKrakenAttackEnd;
|
||||||
dd::EventRelay<ProjectileSystem, dd::Events::HitPad> m_EHitPad;
|
dd::EventRelay<ProjectileSystem, dd::Events::HitPad> m_EHitPad;
|
||||||
dd::EventRelay<ProjectileSystem, dd::Events::ActionButton> m_EActionButton;
|
dd::EventRelay<ProjectileSystem, dd::Events::ActionButton> m_EActionButton;
|
||||||
|
|
||||||
@@ -68,6 +73,8 @@ private:
|
|||||||
bool OnPause(const dd::Events::Pause &event);
|
bool OnPause(const dd::Events::Pause &event);
|
||||||
bool OnResume(const dd::Events::Resume &event);
|
bool OnResume(const dd::Events::Resume &event);
|
||||||
bool OnInkBlaster(const dd::Events::InkBlaster &event);
|
bool OnInkBlaster(const dd::Events::InkBlaster &event);
|
||||||
|
bool OnKrakenAttack(const dd::Events::KrakenAttack &event);
|
||||||
|
bool OnKrakenAttackEnd(const dd::Events::KrakenAttackEnd &event);
|
||||||
bool OnHitPad(const dd::Events::HitPad &event);
|
bool OnHitPad(const dd::Events::HitPad &event);
|
||||||
bool OnActionButton(const dd::Events::ActionButton &event);
|
bool OnActionButton(const dd::Events::ActionButton &event);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -21,6 +21,8 @@ void dd::Systems::BallSystem::Initialize()
|
|||||||
EVENT_SUBSCRIBE_MEMBER(m_EStickyPad, &BallSystem::OnStickyPad);
|
EVENT_SUBSCRIBE_MEMBER(m_EStickyPad, &BallSystem::OnStickyPad);
|
||||||
EVENT_SUBSCRIBE_MEMBER(m_EInkBlaster, &BallSystem::OnInkBlaster);
|
EVENT_SUBSCRIBE_MEMBER(m_EInkBlaster, &BallSystem::OnInkBlaster);
|
||||||
EVENT_SUBSCRIBE_MEMBER(m_EInkBlasterOver, &BallSystem::OnInkBlasterOver);
|
EVENT_SUBSCRIBE_MEMBER(m_EInkBlasterOver, &BallSystem::OnInkBlasterOver);
|
||||||
|
EVENT_SUBSCRIBE_MEMBER(m_EKrakenAttack, &BallSystem::OnKrakenAttack);
|
||||||
|
EVENT_SUBSCRIBE_MEMBER(m_EKrakenAttackEnd, &BallSystem::OnKrakenAttackEnd);
|
||||||
EVENT_SUBSCRIBE_MEMBER(m_EPause, &BallSystem::OnPause);
|
EVENT_SUBSCRIBE_MEMBER(m_EPause, &BallSystem::OnPause);
|
||||||
EVENT_SUBSCRIBE_MEMBER(m_EResume, &BallSystem::OnResume);
|
EVENT_SUBSCRIBE_MEMBER(m_EResume, &BallSystem::OnResume);
|
||||||
EVENT_SUBSCRIBE_MEMBER(m_EActionButton, &BallSystem::OnActionButton);
|
EVENT_SUBSCRIBE_MEMBER(m_EActionButton, &BallSystem::OnActionButton);
|
||||||
@@ -72,6 +74,11 @@ void dd::Systems::BallSystem::Update(double dt)
|
|||||||
{
|
{
|
||||||
if (Lives() == 0)
|
if (Lives() == 0)
|
||||||
{
|
{
|
||||||
|
if (m_KrakenAttack) {
|
||||||
|
Events::KrakenAttackEnd e;
|
||||||
|
EventBroker->Publish(e);
|
||||||
|
}
|
||||||
|
|
||||||
Events::GameOver e;
|
Events::GameOver e;
|
||||||
EventBroker->Publish(e);
|
EventBroker->Publish(e);
|
||||||
|
|
||||||
@@ -526,11 +533,25 @@ bool dd::Systems::BallSystem::OnInkBlasterOver(const dd::Events::InkBlasterOver
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool dd::Systems::BallSystem::OnKrakenAttack(const dd::Events::KrakenAttack &event)
|
||||||
|
{
|
||||||
|
m_KrakenAttack = true;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool dd::Systems::BallSystem::OnKrakenAttackEnd(const dd::Events::KrakenAttackEnd &event)
|
||||||
|
{
|
||||||
|
m_KrakenAttack = false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
bool dd::Systems::BallSystem::OnActionButton(const dd::Events::ActionButton &event)
|
bool dd::Systems::BallSystem::OnActionButton(const dd::Events::ActionButton &event)
|
||||||
{
|
{
|
||||||
if (!m_StageBlockedWaiting) {
|
if (!m_KrakenAttack) {
|
||||||
if (!m_InkBlockedWaiting) {
|
if (!m_StageBlockedWaiting) {
|
||||||
m_Waiting = false;
|
if (!m_InkBlockedWaiting) {
|
||||||
|
m_Waiting = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -95,6 +95,7 @@ void dd::Systems::KrakenSystem::UpdateEntity(double dt, EntityID entity, EntityI
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 2: // Grabbing
|
case 2: // Grabbing
|
||||||
|
m_NumberOfActions++;
|
||||||
kraken->CurrentAction = 5;
|
kraken->CurrentAction = 5;
|
||||||
krakenAttack.ChargeUpdate = 0;
|
krakenAttack.ChargeUpdate = 0;
|
||||||
krakenAttack.KrakenStrength = 0.1;
|
krakenAttack.KrakenStrength = 0.1;
|
||||||
@@ -103,6 +104,7 @@ void dd::Systems::KrakenSystem::UpdateEntity(double dt, EntityID entity, EntityI
|
|||||||
break;
|
break;
|
||||||
case 3: // Brick Generating
|
case 3: // Brick Generating
|
||||||
{
|
{
|
||||||
|
m_NumberOfActions++;
|
||||||
kraken->CurrentAction = 1;
|
kraken->CurrentAction = 1;
|
||||||
Events::BrickGenerating e;
|
Events::BrickGenerating e;
|
||||||
e.Origin1 = glm::vec3(-5, 7, -10);
|
e.Origin1 = glm::vec3(-5, 7, -10);
|
||||||
@@ -187,6 +189,11 @@ bool dd::Systems::KrakenSystem::OnContact(const dd::Events::Contact &event)
|
|||||||
|
|
||||||
auto ball = m_World->GetComponent<Components::Ball>(otherEntitiy);
|
auto ball = m_World->GetComponent<Components::Ball>(otherEntitiy);
|
||||||
if (ball != nullptr) {
|
if (ball != nullptr) {
|
||||||
|
ball->Combo += 1;
|
||||||
|
Events::ComboEvent ec;
|
||||||
|
ec.Combo = ball->Combo;
|
||||||
|
ec.Ball = otherEntitiy;
|
||||||
|
EventBroker->Publish(ec);
|
||||||
Events::KrakenHit e;
|
Events::KrakenHit e;
|
||||||
e.Kraken = krakenEntity;
|
e.Kraken = krakenEntity;
|
||||||
e.Hitter = otherEntitiy;
|
e.Hitter = otherEntitiy;
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ void dd::Systems::PadSystem::Initialize()
|
|||||||
EVENT_SUBSCRIBE_MEMBER(m_EPause, &PadSystem::OnPause);
|
EVENT_SUBSCRIBE_MEMBER(m_EPause, &PadSystem::OnPause);
|
||||||
EVENT_SUBSCRIBE_MEMBER(m_EResume, &PadSystem::OnResume);
|
EVENT_SUBSCRIBE_MEMBER(m_EResume, &PadSystem::OnResume);
|
||||||
EVENT_SUBSCRIBE_MEMBER(m_EKrakenAttack, &PadSystem::OnKrakenAttack);
|
EVENT_SUBSCRIBE_MEMBER(m_EKrakenAttack, &PadSystem::OnKrakenAttack);
|
||||||
|
EVENT_SUBSCRIBE_MEMBER(m_EKrakenAttackEnd, &PadSystem::OnKrakenAttackEnd);
|
||||||
EVENT_SUBSCRIBE_MEMBER(m_EStickyPad, &PadSystem::OnStickyPad);
|
EVENT_SUBSCRIBE_MEMBER(m_EStickyPad, &PadSystem::OnStickyPad);
|
||||||
EVENT_SUBSCRIBE_MEMBER(m_EStickyAttachedToPad, &PadSystem::OnStickyAttachedToPad);
|
EVENT_SUBSCRIBE_MEMBER(m_EStickyAttachedToPad, &PadSystem::OnStickyAttachedToPad);
|
||||||
EVENT_SUBSCRIBE_MEMBER(m_EActionButton, &PadSystem::OnActionButton);
|
EVENT_SUBSCRIBE_MEMBER(m_EActionButton, &PadSystem::OnActionButton);
|
||||||
@@ -479,13 +480,21 @@ bool dd::Systems::PadSystem::OnKrakenAttack(const dd::Events::KrakenAttack &even
|
|||||||
SetAcceleration(acceleration);
|
SetAcceleration(acceleration);
|
||||||
} else if (m_KrakenCharge >= 1) {
|
} else if (m_KrakenCharge >= 1) {
|
||||||
m_KrakenAttack = false;
|
m_KrakenAttack = false;
|
||||||
m_KrakenCharge = 0;
|
Events::KrakenAttackEnd e;
|
||||||
m_KrakenStrength = 0;
|
EventBroker->Publish(e);
|
||||||
m_PlayerStrength = 0;
|
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool dd::Systems::PadSystem::OnKrakenAttackEnd(const dd::Events::KrakenAttackEnd &event)
|
||||||
|
{
|
||||||
|
m_KrakenAttack = false;
|
||||||
|
m_KrakenCharge = 0;
|
||||||
|
m_KrakenStrength = 0;
|
||||||
|
m_PlayerStrength = 0;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
bool dd::Systems::PadSystem::OnStickyPad(const dd::Events::StickyPad &event)
|
bool dd::Systems::PadSystem::OnStickyPad(const dd::Events::StickyPad &event)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -13,6 +13,8 @@ void dd::Systems::ProjectileSystem::Initialize()
|
|||||||
EVENT_SUBSCRIBE_MEMBER(m_EPause, &ProjectileSystem::OnPause);
|
EVENT_SUBSCRIBE_MEMBER(m_EPause, &ProjectileSystem::OnPause);
|
||||||
EVENT_SUBSCRIBE_MEMBER(m_EResume, &ProjectileSystem::OnResume);
|
EVENT_SUBSCRIBE_MEMBER(m_EResume, &ProjectileSystem::OnResume);
|
||||||
EVENT_SUBSCRIBE_MEMBER(m_EInkBlaster, &ProjectileSystem::OnInkBlaster);
|
EVENT_SUBSCRIBE_MEMBER(m_EInkBlaster, &ProjectileSystem::OnInkBlaster);
|
||||||
|
EVENT_SUBSCRIBE_MEMBER(m_EKrakenAttack, &ProjectileSystem::OnKrakenAttack);
|
||||||
|
EVENT_SUBSCRIBE_MEMBER(m_EKrakenAttackEnd, &ProjectileSystem::OnKrakenAttackEnd);
|
||||||
EVENT_SUBSCRIBE_MEMBER(m_EHitPad, &ProjectileSystem::OnHitPad);
|
EVENT_SUBSCRIBE_MEMBER(m_EHitPad, &ProjectileSystem::OnHitPad);
|
||||||
EVENT_SUBSCRIBE_MEMBER(m_EActionButton, &ProjectileSystem::OnActionButton);
|
EVENT_SUBSCRIBE_MEMBER(m_EActionButton, &ProjectileSystem::OnActionButton);
|
||||||
|
|
||||||
@@ -113,34 +115,48 @@ bool dd::Systems::ProjectileSystem::OnHitPad(const dd::Events::HitPad &event)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool dd::Systems::ProjectileSystem::OnKrakenAttack(const dd::Events::KrakenAttack &event)
|
||||||
|
{
|
||||||
|
m_KrakenAttack = true;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool dd::Systems::ProjectileSystem::OnKrakenAttackEnd(const dd::Events::KrakenAttackEnd &event)
|
||||||
|
{
|
||||||
|
m_KrakenAttack = false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
bool dd::Systems::ProjectileSystem::OnActionButton(const dd::Events::ActionButton &event)
|
bool dd::Systems::ProjectileSystem::OnActionButton(const dd::Events::ActionButton &event)
|
||||||
{
|
{
|
||||||
if (m_InkBlaster && m_SquidLoaded) {
|
if (!m_KrakenAttack) {
|
||||||
auto ent = m_World->CloneEntity(m_InkBlastTemplate);
|
if (m_InkBlaster && m_SquidLoaded) {
|
||||||
m_World->RemoveComponent<Components::Template>(ent);
|
auto ent = m_World->CloneEntity(m_InkBlastTemplate);
|
||||||
auto projectile = m_World->GetComponent<Components::Projectile>(ent);
|
m_World->RemoveComponent<Components::Template>(ent);
|
||||||
projectile->Speed = m_InkBlasterSpeed;
|
auto projectile = m_World->GetComponent<Components::Projectile>(ent);
|
||||||
auto transform = m_World->GetComponent<Components::Transform>(ent);
|
projectile->Speed = m_InkBlasterSpeed;
|
||||||
transform->Position = event.Position;
|
auto transform = m_World->GetComponent<Components::Transform>(ent);
|
||||||
transform->Velocity = glm::vec3(0, projectile->Speed, 0);
|
transform->Position = event.Position;
|
||||||
m_Shots--;
|
transform->Velocity = glm::vec3(0, projectile->Speed, 0);
|
||||||
if (m_Shots <= 0) {
|
m_Shots--;
|
||||||
auto ball = m_World->GetComponent<Components::Ball>(m_AttachedSquid);
|
if (m_Shots <= 0) {
|
||||||
m_InkBlaster = false;
|
auto ball = m_World->GetComponent<Components::Ball>(m_AttachedSquid);
|
||||||
m_SquidLoaded = false;
|
m_InkBlaster = false;
|
||||||
ball->InkBlaster = false;
|
m_SquidLoaded = false;
|
||||||
ball->Sticky = false;
|
ball->InkBlaster = false;
|
||||||
ball->Waiting = true;
|
ball->Sticky = false;
|
||||||
|
ball->Waiting = true;
|
||||||
{
|
|
||||||
Events::InkBlasterOver e;
|
{
|
||||||
e.Ball = m_AttachedSquid;
|
Events::InkBlasterOver e;
|
||||||
EventBroker->Publish(e);
|
e.Ball = m_AttachedSquid;
|
||||||
}
|
EventBroker->Publish(e);
|
||||||
|
}
|
||||||
{
|
{
|
||||||
Events::ActionButton e;
|
Events::ActionButton e;
|
||||||
EventBroker->Publish(e);
|
EventBroker->Publish(e);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Reference in New Issue
Block a user