Exemplo n.º 1
0
 bool BattleWalkFighter::PreGetObject()
 { 
     if(!_target || !_target->getHP())
     {
         if(!_count)
             _target = GetField()->GetTargetForRide(!GetSideInBS(), getPosX(),getPosY(), 2);
         else
         {
             if(_target)
             {
                 //COUT << "战将编号"  << static_cast<UInt32>(_target->GetBSNumber()) << "死亡。 ";
             _target = GetField()->GetTarget(!GetSideInBS(),getPosX(),getPosY());
             }
             if(_target)
             {
                 //COUT << "战将编号"  << static_cast<UInt32>(GetBSNumber()) << "锁定目标" << static_cast<UInt32>(_target->GetBSNumber()) << std::endl;
             }
         }
         SetMove(true);
         ++_count;
         BuildLocalStream(e_run);
     }
     if(_target)
         SetBattleTargetPos(_target->getPosX(),_target->getPosY());
     return true;
 } 
Exemplo n.º 2
0
drape_ptr<SequenceAnimation> GetPrettyMoveAnimation(ScreenBase const & screen, double startScale, double endScale,
                                                    m2::PointD const & startPt, m2::PointD const & endPt)
{
  double const moveDuration = PositionInterpolator::GetMoveDuration(startPt, endPt, screen.PixelRectIn3d(), startScale);
  ASSERT_GREATER(moveDuration, 0.0, ());

  double const scaleFactor = moveDuration / kMaxAnimationTimeSec * 2.0;

  auto sequenceAnim = make_unique_dp<SequenceAnimation>();
  sequenceAnim->SetCustomType(kPrettyMoveAnim);

  auto zoomOutAnim = make_unique_dp<MapLinearAnimation>();
  zoomOutAnim->SetScale(startScale, startScale * scaleFactor);
  zoomOutAnim->SetMaxDuration(kMaxAnimationTimeSec * 0.5);

  //TODO (in future): Pass fixed duration instead of screen.
  auto moveAnim = make_unique_dp<MapLinearAnimation>();
  moveAnim->SetMove(startPt, endPt, screen);
  moveAnim->SetMaxDuration(kMaxAnimationTimeSec);

  auto zoomInAnim = make_unique_dp<MapLinearAnimation>();
  zoomInAnim->SetScale(startScale * scaleFactor, endScale);
  zoomInAnim->SetMaxDuration(kMaxAnimationTimeSec * 0.5);

  sequenceAnim->AddAnimation(move(zoomOutAnim));
  sequenceAnim->AddAnimation(move(moveAnim));
  sequenceAnim->AddAnimation(move(zoomInAnim));
  return sequenceAnim;
}
Exemplo n.º 3
0
/* ARGSUSED1 */
void agvHandleKeys(unsigned char key, int x, int y)
{
  if (MoveMode != FLYING)
    return;

  if (key >= '0' && key <= '9')
    SetMove(SPEEDFUNCTION((key-'0')));
  else
    switch(key) {
      case '+':  
        if (EyeMove == 0)
          SetMove(MINMOVE);
         else
	  SetMove(EyeMove *= (1 + MOVEFRACTION));
        break;
      case '-':
	SetMove(EyeMove *= (1 - MOVEFRACTION));
        break;
    }
}
Exemplo n.º 4
0
	void ShooterScene::RegisterMove(const wstring& instance, const Millisec delay, const Millisec dur,
		const Vec2<int> from, const Vec2<int> to, const Animation::TransitType ttype)
	{
		//移動タスクを登録
		auto newTask = new MoveTask(instance);
		newTask->SetDeployTiming(delay);
		newTask->SetTimer(m_activeSceneTimer);
		newTask->SetMove(dur, from, to, ttype);

		m_taskList.push_back(newTask);
	}
Exemplo n.º 5
0
drape_ptr<MapLinearAnimation> GetRectAnimation(ScreenBase const & startScreen, ScreenBase const & endScreen)
{
  auto anim = make_unique_dp<MapLinearAnimation>();

  anim->SetRotate(startScreen.GetAngle(), endScreen.GetAngle());
  anim->SetMove(startScreen.GetOrg(), endScreen.GetOrg(),
                startScreen.PixelRectIn3d(), (startScreen.GetScale() + endScreen.GetScale()) / 2.0);
  anim->SetScale(startScreen.GetScale(), endScreen.GetScale());
  anim->SetMaxScaleDuration(kMaxAnimationTimeSec);

  return anim;
}
Exemplo n.º 6
0
drape_ptr<MapLinearAnimation> GetSetRectAnimation(ScreenBase const & screen,
                                                  m2::AnyRectD const & startRect, m2::AnyRectD const & endRect)
{
  auto anim = make_unique_dp<MapLinearAnimation>();

  double const startScale = CalculateScale(screen.PixelRect(), startRect.GetLocalRect());
  double const endScale = CalculateScale(screen.PixelRect(), endRect.GetLocalRect());

  anim->SetRotate(startRect.Angle().val(), endRect.Angle().val());
  anim->SetMove(startRect.GlobalCenter(), endRect.GlobalCenter(), screen);
  anim->SetScale(startScale, endScale);
  anim->SetMaxScaleDuration(kMaxAnimationTimeSec);

  return anim;
}
Exemplo n.º 7
0
CObject_Appletree::CObject_Appletree(int GHandle, double x, double y, int Width, int Height, unsigned int Type) : CObject_Enemy(GHandle, x, y, Width, Height, Type)
{
	GraphHandle = ResourceManager::getResourceManager()->GetRes(GHandle);
	Stand	= new CSprite(GetResourceWithKey(IMAGE_OBJECT_APPLETREE_STAND), 1, 0, 0, 1, 1, 358, 482, 100, TRUE);
	Hit		= new CSprite(GetResourceWithKey(IMAGE_OBJECT_APPLETREE_HIT), 1, 0, 0, 1, 1, 358, 482, 100, TRUE);
	Death	= new CSprite(GetResourceWithKey(IMAGE_OBJECT_APPLETREE_DEAD), 7, 0, 0, 7, 1, 2506, 482, 65, TRUE);
	Poison	= new CSprite(GetResourceWithKey(IMAGE_OBJECT_APPLETREE_POISON), 8, 0, 0, 8, 1, 3200, 480, 120, TRUE);
	Apple[0]= new CSprite(GetResourceWithKey(IMAGE_OBJECT_APPLE_BREAK), 6, 0, 0, 6, 1, 696, 108, 50, TRUE);
	Apple[1]= new CSprite(GetResourceWithKey(IMAGE_OBJECT_APPLE_BREAK), 6, 0, 0, 6, 1, 696, 108, 50, TRUE);
	Break[0]= new CSprite(GetResourceWithKey(IMAGE_OBJECT_APPLE_BREAK), 6, 0, 0, 6, 1, 696, 108, 64, TRUE);
	Break[1]= new CSprite(GetResourceWithKey(IMAGE_OBJECT_APPLE_BREAK), 6, 0, 0, 6, 1, 696, 108, 64, TRUE);
	Boom[0]	= new CSprite(GetResourceWithKey(IMAGE_OBJECT_APPLE_BOOM), 7, 0, 0, 7, 1, 1610, 230, 128, TRUE);
	Boom[1]	= new CSprite(GetResourceWithKey(IMAGE_OBJECT_APPLE_BOOM), 7, 0, 0, 7, 1, 1610, 230, 128, TRUE);

	b_left = true;
	b_right = false;

	Center = WorldX + 133;
	
	RecognizeRange = 550;
	AttackRange = 225;
	//PatrolRange = -1;

	SetMove(false);
	SetAttack(false);
	SetHit(false);

	AttackDelay = 270;
	AttackCount = -1;
	HeroKnockbackCount = -1;
	KnockbackCount = -1;
	HitCount = -1;

	Stat_ST = 40;
	Damage = Stat_ST * 0.5f;
	Stat_HP = 8;
	MaxHP = Stat_HP * 3;
	HP = MaxHP;
	Speed = 0;

	Exp = 0;

	tempY[0] = (int)fDrawY;
	tempY[1] = (int)fDrawY;
	b_apple[0] = false;
	b_apple[1] = false;

}
Exemplo n.º 8
0
drape_ptr<SequenceAnimation> GetPrettyFollowAnimation(ScreenBase const & startScreen, m2::PointD const & userPos, double targetScale,
                                                      double targetAngle, m2::PointD const & endPixelPos)
{
  auto sequenceAnim = make_unique_dp<SequenceAnimation>();
  sequenceAnim->SetCustomType(kPrettyFollowAnim);

  m2::RectD const viewportRect = startScreen.PixelRectIn3d();

  ScreenBase tmp = startScreen;
  tmp.SetAngle(targetAngle);
  tmp.MatchGandP3d(userPos, viewportRect.Center());

  double const moveDuration = PositionInterpolator::GetMoveDuration(startScreen.GetOrg(), tmp.GetOrg(), startScreen);
  ASSERT_GREATER(moveDuration, 0.0, ());

  double const scaleFactor = moveDuration / kMaxAnimationTimeSec * 2.0;

  tmp = startScreen;

  if (moveDuration > 0.0)
  {
    tmp.SetScale(startScreen.GetScale() * scaleFactor);

    auto zoomOutAnim = make_unique_dp<MapLinearAnimation>();
    zoomOutAnim->SetScale(startScreen.GetScale(), tmp.GetScale());
    zoomOutAnim->SetMaxDuration(kMaxAnimationTimeSec * 0.5);
    sequenceAnim->AddAnimation(move(zoomOutAnim));

    tmp.MatchGandP3d(userPos, viewportRect.Center());

    auto moveAnim = make_unique_dp<MapLinearAnimation>();
    moveAnim->SetMove(startScreen.GetOrg(), tmp.GetOrg(), viewportRect, tmp.GetScale());
    moveAnim->SetMaxDuration(kMaxAnimationTimeSec);
    sequenceAnim->AddAnimation(move(moveAnim));
  }

  auto followAnim = make_unique_dp<MapFollowAnimation>(tmp, userPos, endPixelPos,
                                                       tmp.GetScale(), targetScale,
                                                       tmp.GetAngle(), targetAngle,
                                                       false /* isAutoZoom */);
  followAnim->SetMaxDuration(kMaxAnimationTimeSec * 0.5);
  sequenceAnim->AddAnimation(move(followAnim));
  return sequenceAnim;
}
Exemplo n.º 9
0
bool Heroes::Move(bool fast)
{
    if(Modes(ACTION)) ResetModes(ACTION);

    // move hero
    if(path.isValid() &&
           (isEnableMove() || (GetSpriteIndex() < 45 && GetSpriteIndex() % 9) || GetSpriteIndex() >= 45))
    {
	// fast move for hide AI
	if(fast)
	{
	    direction = path.GetFrontDirection();
    	    MoveStep(true);

	    return true;
	}
	else
	{
    	    // if need change through the circle
	    if(GetDirection() != path.GetFrontDirection())
    	    {
                AngleStep(path.GetFrontDirection());
            }
            else
            // move
    	    if(MoveStep())
    	    {
    		if(isFreeman()) return false;

		return true;
    	    }
	}
    }
    else
    {
	SetMove(false);
    }

    return false;
}
Exemplo n.º 10
0
//	パワーアーツ
bool	Thief::PowerArts(void)
{
	if ( !initflag )
	{
		artsTimer = 0;
		sound->PlaySE( SE::KAITO_POWER );
		initflag = true;
	}

	SetMotion(THIEF::MOTION_DATA::POWERARTS);
	//if (obj->GetFrame() >= 277) obj->SetFrame(277);

	//	行列から情報取得
	Vector3	front = GetFront();
	Vector3	p_pos = GetPos();
	SetMove(Vector3(0.0f, move.y, 0.0f));

	//	情報設定
	p_pos.y += 1.0f;
	Vector3	vec = front * 1.0f;

	float	 bulletSpeed = 0.8f;
	int playerNum = GetPlayerNum();


	if (artsTimer == 0/* obj->GetFrame() == ○○ */)
	{
		m_BulletManager->Set(BULLET_TYPE::THIEF_02, new ThiefBullet02, p_pos, vec, bulletSpeed, playerNum);
	}
	artsTimer++;

	if (obj->GetFrame() == THIEF::MOTION_FRAME::POWERARTS_END)
		{
			artsTimer = 0;
			initflag = false;
			return true;
		}
	return	false;
}
Exemplo n.º 11
0
//	ハイパーアーツ
bool	Thief::HyperArts(void)
{

	//空中で発動しても停止する
	move = Vector3(0, -GRAVITY, 0);

	if ( !initflag )
	{
		sound->PlaySE( SE::HYPER_ATTACK );
		sound->PlaySE( SE::KAITO_HYPER );
		initflag = true;
	}

	attackInfo.power = OFFENSIVE_POWER::HYPER;
	attackInfo.dropPower = DROP_POWER::HYPER;
	attackInfo.coinDropType = DROP_TYPE::SUCTION;

	SetParameterState(PARAMETER_STATE::UNRIVALED);
	move = Vector3(0, 0 - GRAVITY, 0);	//撃ってる間は静止させる
	SetMotion(THIEF::MOTION_DATA::HYPERARTS);


	//	行列から情報取得
	Vector3	front = GetFront();
	Vector3	right = GetRight();
	Vector3	p_pos = GetPos();
	SetMove(Vector3(0.0f, move.y, 0.0f));


	if (obj->GetFrame() >= THIEF::MOTION_FRAME::HYPERARTS_ATTACKSTART/* && obj->GetFrame() < THIEF::MOTION_FRAME::HYPERARTS_ATTACKEND*/)
	{
		float t = GetBezier(ePrm_t::eRapid_Lv5, ePrm_t::eSlow_Lv1, attackInfo.t);
		Vector3 f = front * (2.0f * sinf(D3DX_PI * t));
		Vector3 r = -right * (2.0f * cosf(D3DX_PI * t));
		attackInfo.bottom = p_pos + f + r;

		switch (HyperStep)
		{
		case 0:
			//	あたり判定のパラメータを与える
			attackInfo.top = attackInfo.bottom + r * HyperRate;
			attackInfo.r = 2.5f;
			HyperRate += 1.0;
			if (HyperRate > 20.0f) HyperStep++;
			break;
		case 1:
			//	パラメータ加算
			attackInfo.top = attackInfo.bottom + f * HyperRate + r * HyperRate;
			attackInfo.t += 0.03f;
			if (attackInfo.t >= 1.0f)
			{
				HyperStep++;
			}
			break;
		case 2:
			//attackInfo.top = attackInfo.bottom + r * rate;
			attackInfo.t = 0.0f;
			HyperRate -= 1.0f;
			break;
		}
		armRenderflag = true;
	}

	Vector3 v1, v2;
	v1 = front;
	v2 = attackInfo.top - attackInfo.bottom;
	v1.Normalize();
	v2.Normalize();
	float armAngle = GetAngle(v1, v2);
	Vector3 cross;
	Vector3Cross(cross, v1, v2);
	if (cross.y < 0) armAngle = -armAngle;

	arm->SetPos(pos);
	arm->SetAngle(angle.y + armAngle);
	arm->SetScale(Vector3(0.03f, 0.03f, HyperRate * 0.01f));
	arm->Update();

	if (HyperRate < 0)
	{
		HyperStep = 0;
		HyperRate = 0;
		armRenderflag = false;
		initflag = false;
		return true;
	}
	return	false;
}
Exemplo n.º 12
0
//	クイックアーツ
bool	Thief::QuickArts(void)
{
	static int time = 0;
	if ( !initflag )
	{
		sound->PlaySE( SE::KAITO_QUICK );
		initflag = true;
	}
	Move();
	//	行列から情報取得
	Vector3	up = GetUp();
	Vector3	right = GetRight();
	Vector3	p_pos = GetPos();
	SetMove(Vector3(0.0f, move.y, 0.0f));

	SetMotion(THIEF::MOTION_DATA::QUICKARTS);
	//if (obj->GetFrame() >= 237) obj->SetMotion(237);

	//	情報設定
	Vector3	vec[3] =
	{
		up * 5.0f + right * 3.0f,
		up * 5.0f,
		up * 5.0f + right * -3.0f
	};
	p_pos.y += 3.0f;
	float	 bulletSpeed = 0.5f;
	int playerNum = GetPlayerNum();


	{	//撃った時に動きが一度止まるパターン
		//					//モーションアトデナオス(ちょうどいい感じのフレームが来たら弾発射)
		//if (time == 0 /* obj->GetFrame() == ○○ */ )
		//{
		//	for (int i = 0; i < 3; i++)
		//	{
		//		m_BulletManager->Set(BULLET_TYPE::THIEF_01 , new ThiefBullet01, p_pos, vec[i], bulletSpeed, playerNum);
		//	}
		//}
		//time++;

		////モーションアトデナオス(終わりのモーションが来たら終了)
		//if (obj->GetFrame() == 237)
		//{
		//	time = 0;
		//	return true;
		//}
	}

	{	//撃った時に動きが止まらないパターン
		for (int i = 0; i < 3; i++)
		{
			m_BulletManager->Set(BULLET_TYPE::THIEF_01 , new ThiefBullet01, p_pos, vec[i], bulletSpeed, playerNum);
		}
		attackInfo.Interval = 60;
		initflag = false;
		return true;

	}
	return	false;
}