Example #1
0
void CK6_BloogletCol(CK_object *a, CK_object *b)
{
  if (b->type == CT_Player && b->currentAction->collide)
  {
    ck_keenIgnoreVertClip = true;
    CK_PhysPushX(b, a);
    ck_keenIgnoreVertClip = false;
  }
  else if (b->type == CT_Stunner)
  {
    int color = a->user1 & 3;
    if (a->user1 > 3)
    {
      CK_object *gem = CK_GetNewObj(false);
      gem->clipped = CLIP_normal;
      gem->zLayer = PRIORITIES - 2;
      gem->type = CT6_Item;
      gem->posX = a->posX;
      gem->posY = a->posY;
      gem->yDirection = IN_motion_Up;
      gem->velY = -40;
      gem->user1 = color;
      gem->user2 = gem->gfxChunk = *CK_ItemSpriteChunks[color];
      gem->user3 = gem->user2 + 2;
      CK_SetAction(gem, CK_GetActionByName("CK_ACT_fallingitem"));
      SD_PlaySound(SOUND_BLOOGLETGEM);
    }

    CK_StunCreature(a, b, CK_GetActionByName(stunnedBloogletActions[color]));
  }
}
Example #2
0
void CK6_BloogCol(CK_object *a, CK_object *b)
{
  if (b->type == CT_Player)
  {
    CK_KillKeen();
  }
  else if (b->type == CT_Stunner)
  {
    CK_StunCreature(a,b,CK_GetActionByName("CK6_ACT_BloogStunned0"));
  }
}
Example #3
0
void CK6_NospikeCol(CK_object *a, CK_object *b)
{
	if (b->type == CT_Player)
	{
		CK_KillKeen();
	}
	else if (b->type == CT_Stunner)
	{
		if (--a->user4 == 0)
		{
			CK_StunCreature(a, b, CK_GetActionByName("CK6_ACT_NospikeStunned0"));
		}
		else
		{
			a->xDirection = ck_keenObj->posX < a->posX ? IN_motion_Left : IN_motion_Right;
			a->user2 |= 0x400;
			a->visible = true;

			if (a->currentAction == CK_GetActionByName("CK6_ACT_NospikeSit0") ||
				a->currentAction == CK_GetActionByName("CK6_ACT_NospikeWalk0"))
				CK_SetAction2(a, CK_GetActionByName("CK6_ACT_NospikeCharge1"));
			else if (a->currentAction == CK_GetActionByName("CK6_ACT_NospikeWalk1"))
				CK_SetAction2(a, CK_GetActionByName("CK6_ACT_NospikeCharge2"));
			else if (a->currentAction == CK_GetActionByName("CK6_ACT_NospikeWalk2"))
				CK_SetAction2(a, CK_GetActionByName("CK6_ACT_NospikeCharge3"));
			else if (a->currentAction == CK_GetActionByName("CK6_ACT_NospikeWalk3"))
				CK_SetAction2(a, CK_GetActionByName("CK6_ACT_NospikeCharge0"));

			CK_ShotHit(b);
		}
	}
	else if (b->type == CT6_Nospike)
	{
		// Two charging nospikes will stun each other if they collide head on
		if ((a->user2 & 0xFF) && (b->user2 & 0xFF) && a->xDirection != b->xDirection)
		{
			a->user1 = a->user2 = a->user3 = 0;
			b->user1 = b->user2 = b->user3 = 0;
			a->user4 = b->user4 = a->type;
			CK_SetAction2(a, CK_GetActionByName("CK6_ACT_NospikeStunned0"));
			CK_SetAction2(b, CK_GetActionByName("CK6_ACT_NospikeStunned0"));
			SD_PlaySound(SOUND_NOSPIKECOLLIDE);
			a->type = b->type = CT6_StunnedCreature;
			a->velY = b->velY = -24;
		}
	}
}
Example #4
0
void CK6_BloogguardCol(CK_object *a, CK_object *b)
{
  if (b->type == CT_Player)
  {
    CK_KillKeen();
  }
  else if (b->type == CT_Stunner)
  {
    if (--a->user2 == 0)
    {
      CK_StunCreature(a, b, CK_GetActionByName("CK6_ACT_BloogguardStunned0"));
    }
    else
    {
      a->user1 = 2;
      a->visible = true;
      CK_ShotHit(b);
    }
  }
}
Example #5
0
void CK6_FlectCol(CK_object *a, CK_object *b)
{
	if (b->type == CT_Player)
	{
		CK_PhysPushX(b, a);
	}
	else if (b->type == CT_Stunner)
	{
		if (b->xDirection == IN_motion_None)
		{
			CK_StunCreature(a, b, CK_GetActionByName("CK6_ACT_FlectStunned0"));
		}
		else if (a->xDirection != b->xDirection)
		{
			b->xDirection = a->xDirection;
			b->user4 = 1; // Shot is hazardous to keen now
			SD_PlaySound(SOUND_FLECTSHOT);
		}
	}
}