// pvp 캐릭터 후진. public bool moveBackward() { _v = cTransformPosition; _v2 = _v; _v2.x += (isPlayerSide)?-1000.0f:1000.0f; _v2.z = 0.0f; _q = Util.getLookRotationQuaternion(_v2 - cTransformPosition); _v2 = _q.eulerAngles; _v2.y += 180.0f; _q.eulerAngles = _v2; if (Xfloat.greaterThan(Quaternion.Angle(_q, tf.rotation), 5)) { tf.rotation = Util.getFixedQuaternionSlerp(tf.rotation, _q, CharacterAction.rotationSpeed * GameManager.globalDeltaTime); } _v -= (IVector3)(tf.forward) * stat.speed * GameManager.globalDeltaTime; _v.y = 0; if (isPlayerSide) { if (Xfloat.greaterThan(_v.x, StageManager.mapStartPosX.Get()) && cm.checkPlayerMonsterBlockLine(this)) { setPosition(_v); } else { state = NORMAL; return(false); } } else { if (Xfloat.lessThan(_v.x, StageManager.mapEndPosX.Get()) && cm.checkMonsterBlockLine(this)) { setPosition(_v); } else { state = NORMAL; return(false); } } //if(_state != WALK) state = BWALK; return(true); }
public bool canMonsterHeroTargetingType1(Monster attacker, int targetIndex = -1) { // 타겟팅 1,2번 _target = null; //<1 : 히어로 전방 A거리(cm), B지름> // - 바닥에 뭔가가 떨어지거나 생성되는 스킬에 적용 // - 타게팅(차징)중 히어로 전방 A거리에 B지름 형태의 (원형 마법진모양의) 타게팅 데칼을 표시함 // - 설정된 지름의 크기에 따라서 원형태의 마법진 이미지의 크기를 변경해서 표시함 // - B지름이 400을 넘어가면 타원으로 (일단;) 늘려서 표시 _fixedLineLeft = -(float)targetAttr[0] - ((float)targetAttr[1]) * 0.5f; _fixedLineRight = -(float)targetAttr[0] + ((float)targetAttr[1]) * 0.5f; if (targetType == Skill.TargetType.ENEMY) { // 플레이어 몬스터에서 고른다. (적의 적군) _target = GameManager.me.characterManager.getCloseEnemyTargetByIndexForHeroMonster(attacker.isPlayerSide, targetIndex); } else { // 적 몬스터에서 고른다. (적의 아군) _target = GameManager.me.characterManager.getCloseTeamTarget(attacker.isPlayerSide, attacker); } if (_target == null) { return(false); } _v = attacker.cTransformPosition; if (Xfloat.greaterThan(_target.cTransformPosition.x, GameManager.me.characterManager.targetZonePlayerLine + _fixedLineLeft) && Xfloat.lessThan(_target.cTransformPosition.x, StageManager.mapEndPosX.Get() + _fixedLineRight)) { attacker.setSkillTarget(_target); attacker.skillTargetChecker = ctFixed; attacker.skillMove = ctMoveFixed; _target = null; return(true); } _target = null; return(false); }
void move(Monster target) { if (GameManager.me.stageManager.playTime - _infoShowTime > 0.5f) { _m = (int)(VectorUtil.Distance(GameManager.me.player.cTransformPosition.x, mon.cTransformPosition.x) * 0.01f); if (_m != _infoValue) { GameManager.me.uiManager.uiPlay.lbChaser.text = "-" + _m + "m"; _infoValue = _m; _infoShowTime = GameManager.me.stageManager.playTime; } } _target = target; mon.attackPosition = Util.getPositionByAngleAndDistanceXZ(0, mon.stat.atkRange + _target.damageRange + mon.damageRange); // hitrange //mon.action.delay = 0.3f; _v = _target.cTransformPosition + mon.attackPosition; if (VectorUtil.DistanceXZ(_target.cTransformPosition, mon.cTransformPosition) <= mon.stat.atkRange + _target.damageRange + mon.damageRange) // hitrange { _v = _target.cTransformPosition - mon.cTransformPosition; _q = Util.getLookRotationQuaternion(_v); // 자리를 다 잡았으면 공격... mon.tf.rotation = Util.getFixedQuaternionSlerp(mon.tf.rotation, _q, CharacterAction.rotationSpeed * GameManager.globalDeltaTime); if ((mon.action.delay > 0 || Xfloat.greaterThan(Quaternion.Angle(_q, mon.tf.rotation), 5)) || _target.isEnabled == false) { mon.state = Monster.NORMAL; mon.action.delay -= GameManager.globalDeltaTime; } else { mon.action.state = CharacterAction.STATE_ACTION; } } else if (mon.cTransformPosition.x + mon.attackPosition.x >= _target.cTransformPosition.x && VectorUtil.Distance(_v.z, mon.cTransformPosition.z) < 5) { //Debug.Log("1"); _v = _target.cTransformPosition - mon.cTransformPosition; _q = Util.getLookRotationQuaternion(_v); // 자리를 다 잡았으면 공격... mon.tf.rotation = Util.getFixedQuaternionSlerp(mon.tf.rotation, _q, CharacterAction.rotationSpeed * GameManager.globalDeltaTime); if ((mon.action.delay > 0 || Xfloat.greaterThan(Quaternion.Angle(_q, mon.tf.rotation), 5)) || _target.isEnabled == false) { mon.state = Monster.NORMAL; mon.action.delay -= GameManager.globalDeltaTime; } else { mon.action.state = CharacterAction.STATE_ACTION; } } else { _v = _target.cTransformPosition + mon.attackPosition; _q = Util.getLookRotationQuaternion(_v - mon.cTransformPosition); mon.tf.rotation = Util.getFixedQuaternionSlerp(mon.tf.rotation, _q, CharacterAction.rotationSpeed * GameManager.globalDeltaTime); _v = mon.cTransformPosition + mon.tf.forward * mon.stat.speed * GameManager.globalDeltaTime; _v.y = 0; mon.setPlayAniRightNow(Monster.WALK); mon.animation[Monster.WALK].speed = 0.3f; mon.setPosition(_v); } }