public override void ApplyHitBoxDamage(int Damage, float Degree, BaseFireSystem Owner, HitBox _hitBox) { base.ApplyHitBoxDamage(Damage, Degree, Owner, _hitBox); if (GodMode) { _hitBox.BasePlayerStateGodModeCallBack(); return; } if (GetComponent <Identity> ().identity == Owner.transform.root.GetComponentInChildren <Identity> ().identity) { _hitBox.BasePlayerStateHitFriendCallBack(); return; } else { _hitBox.BasePlayerStateHittedCallBack(Damage, Health); } //if (GameNetwork.OfflineMode) { //} else { // syncActionPhotonView.RPC ("ApplyDamageByOtherPlayer", PhotonTargets.OthersBuffered, Damage); //} Health -= Damage; OnAttacked(Owner.transform.root.GetComponentInChildren <Identity> ().gameObject); if (Health <= 0 && SendDeadMesssageToTankFire == false) { SendDeadMesssageToTankFire = true; Owner.KillTank(TankName); Owner.AddDamage(Damage, TankName); } if (SendDeadMesssageToTankFire == false) { Owner.AddDamage(Damage, TankName); } if (Health <= 0) { OnDeadActionCalled(); } #if ClientCode GetComponent <Identity>().UpdateHealth(Health); #endif }
public override void ApplyHitBoxDamage(int Damage, float Degree, BaseFireSystem Owner, HitBox _hitBox) { base.ApplyHitBoxDamage(Damage, Degree, Owner, _hitBox); Debug.Log("ApplyHitBoxDamage"); // GameObject owner = (GameObject)HitInfos[1]; // if (GodMode) { _hitBox.BasePlayerStateGodModeCallBack(); return; } if (GetComponent <Identity> ().identity == Owner.transform.root.GetComponentInChildren <Identity> ().identity) { _hitBox.BasePlayerStateHitFriendCallBack(); return; } else { _hitBox.BasePlayerStateHittedCallBack(Damage, Health); } Health -= Damage; if (Health <= 0) { OnDeadActionCalled(); } if (Health <= 0 && !SendDeadMesssageToTankFire) { SendDeadMesssageToTankFire = true; Owner.KillTank(TankName); Owner.AddDamage(Damage, TankName); } if (SendDeadMesssageToTankFire == false) { Owner.AddDamage(Damage, TankName); } RepairTankCountDown = 0; CaptureCountDown = 0; UpdateHealthBar(); }
public virtual void ApplyHitBoxDamage(int Damage, float Degree, BaseFireSystem Owner, HitBox _hitBox) { Debug.Log("Base.ApplyHitBoxDamage"); }