private bool frameMurder(ActorChMonster actorCh) { actorCh.AiMoveCount--; if(actorCh.AiMoveCount < 0){ /* if(StaticDataList.getRandom(0,4) == 0 && actorCh.TexId == 0 && FarmerCount > (int)Data.SetupValue.BattleMoveFarmerDisCount){ actorCh.FrameFlag = false; actorCh.AiMoveCount = (int)(Data.SetupValue.CharMoveChangeTime + StaticDataList.getRandom(-(int)(Data.SetupValue.CharMoveChangeRandTime),(int)Data.SetupValue.CharMoveChangeRandTime)); return true; }else if(StaticDataList.getRandom(0,4) == 0 && actorCh.TexId == 2 && PriestCount > (int)Data.SetupValue.BattleMovePriestDisCount){ actorCh.FrameFlag = false; actorCh.AiMoveCount = (int)(Data.SetupValue.CharMoveChangeTime + StaticDataList.getRandom(-(int)(Data.SetupValue.CharMoveChangeRandTime),(int)Data.SetupValue.CharMoveChangeRandTime)); return true; }else if(StaticDataList.getRandom(0,4) == 0 && actorCh.TexId == 3 && EnemyCount > (int)Data.SetupValue.BattleMoveEnemyDisCount){ actorCh.FrameFlag = false; actorCh.AiMoveCount = (int)(Data.SetupValue.CharMoveChangeTime + StaticDataList.getRandom(-(int)(Data.SetupValue.CharMoveChangeRandTime),(int)Data.SetupValue.CharMoveChangeRandTime)); return true; }else{ actorCh.FrameFlag = true; } */ actorCh.MovedFlag = true; if(actorCh.TexId == 3){ if(EnemyCount != 0 && WarriorCount == 0){ actorCh.AiMoveRot += Common.VectorUtil.GetRotY(actorCh.AiMoveRot ,actorCh.BasePos,(EnemyCenterPos+PriestCenterPos+FarmerCenterPos)/3) + StaticDataList.getRandom(-30,30); } }else if(actorCh.TexId == 4){ // Vector3 tempvector = EnemyCenterPos -WarriorCenterPos; // tempvector.Normalize(); // actorCh.AiMoveRot += Common.VectorUtil.GetRotY( actorCh.AiMoveRot,actorCh.BasePos,EnemyCenterPos ) + StaticDataList.getRandom(-20,20); actorCh.AiMoveRot += Common.VectorUtil.GetRotY( actorCh.AiMoveRot,actorCh.BasePos,EnemyCenterPos ) + StaticDataList.getRandom(-20,20); ctrlResMgr.AddEnemyFromNecro = true; ctrlResMgr.AddEnemyPos = actorCh.BasePos; }else{ int ToNumber = ctrlResMgr.CtrlTo.GetEntryNum(); if(ToNumber == 0){ actorCh.AiMoveRot = (int)StaticDataList.getRandom(360); }else{ Vector3 TargetPos = ctrlResMgr.CtrlTo.GetPos(StaticDataList.getRandom(0,ToNumber)); float tempRot = Common.VectorUtil.GetRotY(actorCh.AiMoveRot, actorCh.BasePos ,TargetPos); actorCh.AiMoveRot += tempRot+StaticDataList.getRandom(-10,10); } } if(actorCh.TexId == 0){ if(StaticDataList.getRandom(0,(int)Data.SetupValue.BattleNouminDeadRand +1) == 0){ actorCh.setdeadFlag(true); } } else if(actorCh.TexId == 2){ if(StaticDataList.getRandom(0,(int)Data.SetupValue.BattleSouryoDeadRand+1) == 0){ actorCh.setdeadFlag(true); } } else if(actorCh.TexId == 3){ if(StaticDataList.getRandom(0,(int)Data.SetupValue.BattleZonbi2DeadRand+1) == 0){ actorCh.setdeadFlag(true); } } if(StaticDataList.getRandom(0,(int)Data.SetupValue.BattleEffectRand+1) == 0){ AppSound.GetInstance().PlaySeCamDis( AppSound.SeId.PlDamage,actorCh.GetBodyPos() ); //ctrlResMgr.CtrlPl.Addeffect(new Vector3( actorCh.BasePos.X + StaticDataList.getRandom(-15,15)/5.0f ,actorCh.BasePos.Y + 0.2f ,actorCh.BasePos.Z+ StaticDataList.getRandom(-15,15)/5.0f)); ctrlResMgr.AddEffectFromEnemy = true; ctrlResMgr.AddEnemyEffectPos = actorCh.BasePos; } actorCh.AiMoveCount = (int)(Data.SetupValue.CharMoveChangeTime + StaticDataList.getRandom(-(int)(Data.SetupValue.CharMoveChangeRandTime),(int)Data.SetupValue.CharMoveChangeRandTime)); if(StaticDataList.getRandom(0,(int)Data.SetupValue.BaloonAppearRand+1) == 0 && actorCh.deadFlagSp == true && speakCount < 6){ actorCh.setAppearCountSp((int)Data.SetupValue.AppearAndLeaveTime); speakCount++; int charVoNumber = StaticDataList.getRandom(3); switch(charVoNumber){ case 0: AppSound.GetInstance().PlaySeCamDis( AppSound.SeId.CharVo1,actorCh.GetBodyPos() ); break; case 1: AppSound.GetInstance().PlaySeCamDis( AppSound.SeId.CharVo2,actorCh.GetBodyPos() ); break; case 2: AppSound.GetInstance().PlaySeCamDis( AppSound.SeId.CharVo3,actorCh.GetBodyPos() ); break; } } if(StaticDataList.getRandom(0,(int)Data.SetupValue.GionAppearRand+1) == 0 && actorCh.deadFlagSp == true && actorCh.TexId == 3){ actorCh.setAppearCountSp((int)Data.SetupValue.GionAppearSpeed); AppSound.GetInstance().PlaySeCamDis( AppSound.SeId.ZonbiVo3,actorCh.GetBodyPos() ); } } if(actorCh.FrameFlag == true){ actorCh.SetStateMove( new Vector3( actorCh.BaseMtx.M31,actorCh.BaseMtx.M32,actorCh.BaseMtx.M33 ), moveSpeed, actorCh.AiMoveRot, false ); }else{ actorCh.SetStateMove( new Vector3( actorCh.BaseMtx.M31,actorCh.BaseMtx.M32,actorCh.BaseMtx.M33 ), 0, actorCh.AiMoveRot, false ); } return true; }
/// private メソッド ///--------------------------------------------------------------------------- /// フレーム:移動 private bool frameMove( ActorChMonster actorCh) { actorCh.AiMoveCount--; if(actorCh.AiMoveCount < 0 ){ actorCh.MovedFlag = true; int ToNumber = ctrlResMgr.CtrlTo.GetEntryNum() + ctrlResMgr.CtrlWall.GetEntryNum(); if(ToNumber == 0){ actorCh.AiMoveRot = (int)StaticDataList.getRandom(0,360); }else{ float dis; if(towerNumber < ctrlResMgr.CtrlTo.GetEntryNum()){ dis = Common.VectorUtil.DistanceXZ(actorCh.BasePos,ctrlResMgr.CtrlTo.GetPos(towerNumber)); if(dis < (int)Data.SetupValue.TowerGlowArea/10.0f && ctrlResMgr.CtrlTo.GetUseActorBaseObj(towerNumber).TexId+(int)Data.Tex2dResId.TowerStart != (int)Data.Tex2dResId.Bosstower){ ctrlResMgr.CtrlTo.GetUseActorBaseObj(towerNumber).glowCounter++; } }else{ dis = Common.VectorUtil.DistanceXZ(actorCh.BasePos,ctrlResMgr.CtrlWall.GetPos(towerNumber-ctrlResMgr.CtrlTo.GetEntryNum())); if(dis < (int)Data.SetupValue.TowerGlowArea/10.0f && ctrlResMgr.CtrlWall.GetUseActorBaseObj(towerNumber-ctrlResMgr.CtrlTo.GetEntryNum()).TexId == 0){ ctrlResMgr.CtrlWall.GetUseActorBaseObj(towerNumber-ctrlResMgr.CtrlTo.GetEntryNum()).glowCounter++; } } int tempcount = 0; while(true){ towerNumber = (int)StaticDataList.getRandom(0,ToNumber); tempcount++; if(tempcount > 2){ break; } if(actorCh.TexId == 0){ if(towerNumber < ctrlResMgr.CtrlTo.GetEntryNum()){ if(ctrlResMgr.CtrlTo.GetUseActorBaseObj(towerNumber).glowFinish == false) break; }else{ if(ctrlResMgr.CtrlWall.GetUseActorBaseObj(towerNumber-ctrlResMgr.CtrlTo.GetEntryNum()).glowFinish == false) break; } }else{ break; } } float tempRot; if(towerNumber < ctrlResMgr.CtrlTo.GetEntryNum()){ tempRot = Common.VectorUtil.GetRotY(actorCh.AiMoveRot, actorCh.BasePos ,ctrlResMgr.CtrlTo.GetPos(towerNumber)); }else{ tempRot = Common.VectorUtil.GetRotY(actorCh.AiMoveRot, actorCh.BasePos ,ctrlResMgr.CtrlWall.GetPos(towerNumber-ctrlResMgr.CtrlTo.GetEntryNum())); } actorCh.AiMoveRot += tempRot+StaticDataList.getRandom(-3,3); } actorCh.AiMoveCount = (int)(Data.SetupValue.CharMoveChangeTime + StaticDataList.getRandom(-(int)(Data.SetupValue.CharMoveChangeRandTime),(int)Data.SetupValue.CharMoveChangeRandTime)); if(StaticDataList.getRandom(0,(int)Data.SetupValue.BaloonAppearRand+1) == 0 && actorCh.deadFlagSp == true && speakCount < 6){ actorCh.setAppearCountSp((int)Data.SetupValue.AppearAndLeaveTime); speakCount++; int charVoNumber = StaticDataList.getRandom(3); switch(charVoNumber){ case 0: AppSound.GetInstance().PlaySeCamDis( AppSound.SeId.CharVo1,actorCh.GetBodyPos() ); break; case 1: AppSound.GetInstance().PlaySeCamDis( AppSound.SeId.CharVo2,actorCh.GetBodyPos() ); break; case 2: AppSound.GetInstance().PlaySeCamDis( AppSound.SeId.CharVo3,actorCh.GetBodyPos() ); break; } } } if(actorCh.FrameFlag == true){ actorCh.SetStateMove( new Vector3( actorCh.BaseMtx.M31,actorCh.BaseMtx.M32,actorCh.BaseMtx.M33 ), moveSpeed, actorCh.AiMoveRot, false ); }else{ actorCh.SetStateMove( new Vector3( actorCh.BaseMtx.M31,actorCh.BaseMtx.M32,actorCh.BaseMtx.M33 ), 0, actorCh.AiMoveRot, false ); } return true; }
private bool frameBreakTower(ActorChMonster actorCh) { actorCh.AiMoveCount--; if(actorCh.AiMoveCount < 0){ /* if(StaticDataList.getRandom(0,4) == 0 && actorCh.TexId == 0 && FarmerCount > (int)Data.SetupValue.BattleMoveFarmerDisCount){ actorCh.FrameFlag = false; actorCh.AiMoveCount = (int)(Data.SetupValue.CharMoveChangeTime + StaticDataList.getRandom(-(int)(Data.SetupValue.CharMoveChangeRandTime),(int)Data.SetupValue.CharMoveChangeRandTime)); return true; }else if(StaticDataList.getRandom(0,4) == 0 && actorCh.TexId == 2 && PriestCount > (int)Data.SetupValue.BattleMovePriestDisCount){ actorCh.FrameFlag = false; actorCh.AiMoveCount = (int)(Data.SetupValue.CharMoveChangeTime + StaticDataList.getRandom(-(int)(Data.SetupValue.CharMoveChangeRandTime),(int)Data.SetupValue.CharMoveChangeRandTime)); return true; }else if(StaticDataList.getRandom(0,4) == 0 && actorCh.TexId == 3 && EnemyCount > (int)Data.SetupValue.BattleMoveEnemyDisCount){ actorCh.FrameFlag = false; actorCh.AiMoveCount = (int)(Data.SetupValue.CharMoveChangeTime + StaticDataList.getRandom(-(int)(Data.SetupValue.CharMoveChangeRandTime),(int)Data.SetupValue.CharMoveChangeRandTime)); return true; }else{ actorCh.FrameFlag = true; } */ actorCh.MovedFlag = true; if(actorCh.TexId == 3 ){ if(towerAttackId < ctrlResMgr.CtrlTo.GetEntryNum()){ actorCh.AiMoveRot += Common.VectorUtil.GetRotY(actorCh.AiMoveRot ,actorCh.BasePos,ctrlResMgr.CtrlTo.GetPos(towerAttackId)) + StaticDataList.getRandom(-30,30); }else{ actorCh.AiMoveRot += Common.VectorUtil.GetRotY(actorCh.AiMoveRot ,actorCh.BasePos,ctrlResMgr.CtrlWall.GetPos(towerAttackId-ctrlResMgr.CtrlTo.GetEntryNum())) + StaticDataList.getRandom(-30,30); } if(StaticDataList.getRandom(0,(int)Data.SetupValue.BattleEffectRand+1) == 0){ //ctrlResMgr.CtrlPl.Addeffect(new Vector3( actorCh.BasePos.X + StaticDataList.getRandom(-15,15)/5.0f ,actorCh.BasePos.Y + 0.2f ,actorCh.BasePos.Z+ StaticDataList.getRandom(-15,15)/5.0f)); ctrlResMgr.AddEffectFromEnemy = true; ctrlResMgr.AddEnemyEffectPos = actorCh.BasePos; } if(StaticDataList.getRandom(0,(int)Data.SetupValue.BattleTowerDeadRand+1) == 0){ if(towerAttackId < ctrlResMgr.CtrlTo.GetEntryNum()){ ctrlResMgr.CtrlTo.killTower(towerAttackId); }else{ ctrlResMgr.CtrlWall.killTower(towerAttackId-ctrlResMgr.CtrlTo.GetEntryNum()); } SetCtrlStateId(CtrlStateId.BattleMove); } } else if(actorCh.TexId == 1 ){ if(towerAttackId < ctrlResMgr.CtrlTo.GetEntryNum()){ actorCh.AiMoveRot += Common.VectorUtil.GetRotY(actorCh.AiMoveRot ,actorCh.BasePos,ctrlResMgr.CtrlTo.GetPos(towerAttackId)) + StaticDataList.getRandom(-10,10); }else{ actorCh.AiMoveRot += Common.VectorUtil.GetRotY(actorCh.AiMoveRot ,actorCh.BasePos,ctrlResMgr.CtrlWall.GetPos(towerAttackId-ctrlResMgr.CtrlTo.GetEntryNum())) + StaticDataList.getRandom(-10,10); } }else if(actorCh.TexId == 4){ if(towerAttackId < ctrlResMgr.CtrlTo.GetEntryNum()){ actorCh.AiMoveRot += Common.VectorUtil.GetRotY(actorCh.AiMoveRot ,actorCh.BasePos,ctrlResMgr.CtrlTo.GetPos(towerAttackId)) + StaticDataList.getRandom(-10,10); }else{ actorCh.AiMoveRot += Common.VectorUtil.GetRotY(actorCh.AiMoveRot ,actorCh.BasePos,ctrlResMgr.CtrlWall.GetPos(towerAttackId-ctrlResMgr.CtrlTo.GetEntryNum())) + StaticDataList.getRandom(-10,10); } ctrlResMgr.AddEnemyFromNecro = true; ctrlResMgr.AddEnemyPos = actorCh.BasePos; } else{ int ToNumber = ctrlResMgr.CtrlTo.GetEntryNum(); if(ToNumber == 0){ actorCh.AiMoveRot = (int)StaticDataList.getRandom(360); }else{ Vector3 TargetPos = ctrlResMgr.CtrlTo.GetPos(StaticDataList.getRandom(0,ToNumber)); float tempRot = Common.VectorUtil.GetRotY(actorCh.AiMoveRot, actorCh.BasePos ,TargetPos); actorCh.AiMoveRot += tempRot+StaticDataList.getRandom(-10,10); } } actorCh.AiMoveCount = (int)(Data.SetupValue.CharMoveChangeTime + StaticDataList.getRandom(-(int)(Data.SetupValue.CharMoveChangeRandTime),(int)Data.SetupValue.CharMoveChangeRandTime)); if(StaticDataList.getRandom(0,(int)Data.SetupValue.BaloonAppearRand+1) == 0 && actorCh.deadFlagSp == true && actorCh.TexId < 3 && speakCount < 6){ actorCh.setAppearCountSp((int)Data.SetupValue.AppearAndLeaveTime); speakCount++; int charVoNumber = StaticDataList.getRandom(3); switch(charVoNumber){ case 0: AppSound.GetInstance().PlaySeCamDis( AppSound.SeId.CharVo1,actorCh.GetBodyPos() ); break; case 1: AppSound.GetInstance().PlaySeCamDis( AppSound.SeId.CharVo2,actorCh.GetBodyPos() ); break; case 2: AppSound.GetInstance().PlaySeCamDis( AppSound.SeId.CharVo3,actorCh.GetBodyPos() ); break; } } if(StaticDataList.getRandom(0,(int)Data.SetupValue.GionAppearRand+1) == 0 && actorCh.deadFlagSp == true && actorCh.TexId == 3){ actorCh.setAppearCountSp((int)Data.SetupValue.GionAppearSpeed); AppSound.GetInstance().PlaySeCamDis( AppSound.SeId.ZonbiVo3,actorCh.GetBodyPos() ); } } if(actorCh.FrameFlag == true){ actorCh.SetStateMove( new Vector3( actorCh.BaseMtx.M31,actorCh.BaseMtx.M32,actorCh.BaseMtx.M33 ), moveSpeed, actorCh.AiMoveRot, false ); }else{ actorCh.SetStateMove( new Vector3( actorCh.BaseMtx.M31,actorCh.BaseMtx.M32,actorCh.BaseMtx.M33 ), 0, actorCh.AiMoveRot, false ); } return true; }
private bool frameEat(ActorChMonster actorCh) { GameCtrlManager ctrlResMgr = GameCtrlManager.GetInstance(); if(actorCh.GetStateId() != ActorChBase.StateId.Eat){ actorCh.AiMoveCount--; if(actorCh.AiMoveCount < 0){ actorCh.AiMoveRot = (int)StaticDataList.getRandom(360); actorCh.AiMoveCount = (int)(Data.SetupValue.CharMoveChangeTime + StaticDataList.getRandom(-(int)(Data.SetupValue.CharMoveChangeRandTime),(int)Data.SetupValue.CharMoveChangeRandTime)); if(StaticDataList.getRandom(0,(int)Data.SetupValue.BaloonAppearRand+1) == 0){ actorCh.setAppearCountSp((int)Data.SetupValue.AppearAndLeaveTime); } } actorCh.SetStateMove( new Vector3( actorCh.BaseMtx.M31,actorCh.BaseMtx.M32,actorCh.BaseMtx.M33 ), moveSpeed, actorCh.AiMoveRot, false ); } return true; }
/// フレーム:移動 private bool frameBattleMove( ActorChMonster actorCh ) { actorCh.AiMoveCount--; if(actorCh.AiMoveCount < 0){ /* if(StaticDataList.getRandom(0,4) == 0 && actorCh.TexId == 0 && FarmerCount > (int)Data.SetupValue.BattleMoveFarmerDisCount){ actorCh.FrameFlag = false; actorCh.AiMoveCount = (int)(Data.SetupValue.CharMoveChangeTime + StaticDataList.getRandom(-(int)(Data.SetupValue.CharMoveChangeRandTime),(int)Data.SetupValue.CharMoveChangeRandTime)); return true; }else if(StaticDataList.getRandom(0,4) == 0 && actorCh.TexId == 2 && PriestCount > (int)Data.SetupValue.BattleMovePriestDisCount){ actorCh.FrameFlag = false; actorCh.AiMoveCount = (int)(Data.SetupValue.CharMoveChangeTime + StaticDataList.getRandom(-(int)(Data.SetupValue.CharMoveChangeRandTime),(int)Data.SetupValue.CharMoveChangeRandTime)); return true; }else{ actorCh.FrameFlag = true; } */ actorCh.MovedFlag = true; if(actorCh.TexId == 1 || actorCh.TexId == 3){ if(WarriorCount != 0){ if(actorCh.TexId == 1){ actorCh.AiMoveRot += Common.VectorUtil.GetRotY( actorCh.AiMoveRot,actorCh.BasePos,EnemyCenterPos) + StaticDataList.getRandom(-20,20); } if(actorCh.TexId == 3){ actorCh.AiMoveRot += Common.VectorUtil.GetRotY( actorCh.AiMoveRot,actorCh.BasePos,WarriorCenterPos) + StaticDataList.getRandom(-20,20); } } else if(WarriorCount == 0){ if(actorCh.TexId == 3){ actorCh.AiMoveRot += Common.VectorUtil.GetRotY( actorCh.AiMoveRot,actorCh.BasePos,(EnemyCenterPos+PriestCenterPos+FarmerCenterPos)/3) + StaticDataList.getRandom(-20,20); } } }else if(actorCh.TexId == 4){ actorCh.AiMoveRot += Common.VectorUtil.GetRotY( actorCh.AiMoveRot,actorCh.BasePos,EnemyCenterPos) + StaticDataList.getRandom(-20,20); ctrlResMgr.AddEnemyFromNecro = true; ctrlResMgr.AddEnemyPos = actorCh.BasePos; ctrlResMgr.AddEffectFromEnemy = true; ctrlResMgr.AddEnemyEffectPos = actorCh.BasePos; }else{ int ToNumber = ctrlResMgr.CtrlTo.GetEntryNum(); if(ToNumber == 0){ actorCh.AiMoveRot = (int)StaticDataList.getRandom(360); }else{ Vector3 TargetPos = ctrlResMgr.CtrlTo.GetPos(StaticDataList.getRandom(0,ToNumber)); float tempRot = Common.VectorUtil.GetRotY(actorCh.AiMoveRot, actorCh.BasePos ,TargetPos); actorCh.AiMoveRot += tempRot+StaticDataList.getRandom(-10,10); } } actorCh.AiMoveCount = (int)(Data.SetupValue.CharMoveChangeTime + StaticDataList.getRandom(-(int)(Data.SetupValue.CharMoveChangeRandTime),(int)Data.SetupValue.CharMoveChangeRandTime)); if(StaticDataList.getRandom(0,(int)Data.SetupValue.BaloonAppearRand+1) == 0 && actorCh.deadFlagSp == true && actorCh.TexId < 3 && speakCount < 6){ actorCh.setAppearCountSp((int)Data.SetupValue.AppearAndLeaveTime); speakCount++; int charVoNumber = StaticDataList.getRandom(3); switch(charVoNumber){ case 0: AppSound.GetInstance().PlaySeCamDis( AppSound.SeId.CharVo1,actorCh.GetBodyPos() ); break; case 1: AppSound.GetInstance().PlaySeCamDis( AppSound.SeId.CharVo2,actorCh.GetBodyPos() ); break; case 2: AppSound.GetInstance().PlaySeCamDis( AppSound.SeId.CharVo3,actorCh.GetBodyPos() ); break; } } } if(actorCh.FrameFlag == true){ actorCh.SetStateMove( new Vector3( actorCh.BaseMtx.M31,actorCh.BaseMtx.M32,actorCh.BaseMtx.M33 ), moveSpeed, actorCh.AiMoveRot, false ); }else{ actorCh.SetStateMove( new Vector3( actorCh.BaseMtx.M31,actorCh.BaseMtx.M32,actorCh.BaseMtx.M33 ), 0, actorCh.AiMoveRot, false ); } return true; }