//AttackRangeの二倍まできたら予告する public void InRangeIlluminate() { E_ModeBase e_mode = (E_ModeBase)Mode; if (Vector2.Distance(transform.position, gameobject_player.transform.position) < e_mode.AttackRange * 1.5) { if (!isIllminate) { Illuminate(illuminatetime); } } }
public override bool Equition(Charactor _obj, ModeBase _mode) { if (_obj.tag.ToString() != "Player") { E_ModeBase e_mode = (E_ModeBase)_mode; if (Vector3.Distance(_obj.transform.position, _obj.gameobject_player.transform.position) < e_mode.AttackRange) { return(!IsOut); } else { return(IsOut); } } return(false); }
// Update is called once per frame void Update() { Invisible = false; e = (E_ModeBase)Mode; base.Update(); if (Mode.index != 1) { if (IsCounter == true) { e.Strength = 3; } else { e.Strength = 2; } } else { e.Strength = 0; } if (IsCounter) { Counter_Apper_Timer += Time.deltaTime; if (Counter_Apper_Timer > Counter_Apper_Time) { IsCounter = false; Counter_Apper_Timer = 0; } } //ルーンプレハブの整備 if (IsCounter && CounterLune == null) { CounterLune = GameObject.Instantiate(CounterLune_Prefab, transform.position, Quaternion.identity); CounterLune.transform.parent = transform; } if (!IsCounter && CounterLune != null) { GameObject.Destroy(CounterLune); } }
public void MakeHitBox() { E_ModeBase e_mode = (E_ModeBase)Mode; e_mode.MakeHitBox(this); }
void OnTriggerEnter2D(Collider2D col) { if (CheckTagForTrigger(col)) { //コーラーの被ダメ判定をtrueにする caller.AttackHit = true;//問題はいつfalseにするか //被ダメ処理 GameObject objop = col.gameObject; damege = objop.GetComponent <Damege>(); //ダメージの数値分だけHPを減らす //ReduceHealth(damege.value); HitBox hitbox = objop.GetComponent <HitBox>(); if (nowflag.IsAbleToBeDameged && !Invisible && (tmp_col != col)) { tmp_col = col; status.HP -= damege.value; //自身がプレイヤーならMPを回収する if (hitbox.chara != null) { hitbox.chara.RecoverMP(hitbox.MPRecover); } } //ダメージ処理 //(プレイヤーの向きを加味したい) bool isHitBoxRight = hitbox.isRight; //プレイヤーの向きによって吹っ飛びの向きを分岐 //↑キャラクタの向きによって吹っ飛びの向きが違うのはおかしいのでは? Vector2 AdjustedDamegeVector; AdjustedDamegeVector = damege.vector; if (!isHitBoxRight) { AdjustedDamegeVector.x *= -1; } //無敵状態でなければ if (nowflag.IsAbleToBeClashed && !Invisible && !hitbox.IsHit) { //強靭度条件を満たしていたら if (col.tag == "PlayerAttack" && tag == E_Tag.Enemy) { E_ModeBase e_mode = (E_ModeBase)GetComponent <TestEnemy>().Mode; if (damege.Strength > e_mode.Strength + status.level) { //つかみかそうでないか if (!hitbox.isGrip) { //HitBoxのColliderより先にこっちが呼ばれていたらIsHitを弄る hitbox.IsHit = true; //実際に吹っ飛ぶ audioPlayer.Play(4); Clash(AdjustedDamegeVector, damege.power, damege.speed); } else { //キャラクターは掴まれる Grip = hitbox; ChangeMode(6); } } else { //ボスならば反撃する if (IsBoss) { Boss b = (Boss)this; if (modetime > 1.0 && b.IsCounter) { ChangeMode(7); } } } } else { //HitBoxのColliderより先にこっちが呼ばれていたらIsHitを弄る hitbox.IsHit = true; //実際に吹っ飛ぶ Clash(AdjustedDamegeVector, damege.power, damege.speed); } //喰らいエフェクトの表示 if (damege.Effect != null) { GameObject ef = GameObject.Instantiate(damege.Effect); ef.transform.position = transform.position; damege.Effect = null; } } } }