示例#1
0
		private void OnTriggerEnter(Collider otherObject)
		{
			if (this._owner && this._owner != otherObject.transform.root && base.transform.root != otherObject.transform.root)
			{
				if (BoltNetwork.isRunning)
				{
					GameObject gameObject = otherObject.transform.root.gameObject;
					BoltEntity component = gameObject.GetComponent<BoltEntity>();
					if (component)
					{
						switch (this._bonusType)
						{
						case WeaponBonus.BonusTypes.Burn:
						{
							Burn burn = Burn.Create(GlobalTargets.OnlyServer);
							burn.Entity = component;
							burn.Send();
							break;
						}
						case WeaponBonus.BonusTypes.Poison:
							if (Vector3.Dot(otherObject.transform.position - base.transform.position, base.transform.forward) > 0.25f)
							{
								Poison poison = Poison.Create(GlobalTargets.OnlyServer);
								poison.Entity = component;
								poison.Send();
							}
							break;
						case WeaponBonus.BonusTypes.DouseBurn:
						{
							Burn burn2 = Burn.Create(GlobalTargets.OnlyServer);
							burn2.Entity = component;
							burn2.Send();
							break;
						}
						}
					}
				}
				switch (this._bonusType)
				{
				case WeaponBonus.BonusTypes.Burn:
					Prefabs.Instance.SpawnFireHitPS(base.transform.position, Quaternion.LookRotation(base.transform.position - otherObject.transform.position));
					otherObject.SendMessage("Burn", SendMessageOptions.DontRequireReceiver);
					break;
				case WeaponBonus.BonusTypes.Poison:
					if (Vector3.Dot(otherObject.transform.position - base.transform.position, base.transform.forward) > 0.25f)
					{
						otherObject.SendMessage("Poison", SendMessageOptions.DontRequireReceiver);
					}
					break;
				case WeaponBonus.BonusTypes.DouseBurn:
					Prefabs.Instance.SpawnFireHitPS(base.transform.position, Quaternion.LookRotation(base.transform.position - otherObject.transform.position));
					otherObject.SendMessage("Douse", SendMessageOptions.DontRequireReceiver);
					otherObject.SendMessage("Burn", SendMessageOptions.DontRequireReceiver);
					break;
				}
			}
		}
示例#2
0
 private void OnTriggerEnter(Collider other)
 {
     if (this.rootTr != other.transform.root)
     {
         other.SendMessage("Douse", this, SendMessageOptions.DontRequireReceiver);
         other.SendMessage("Burn", this, SendMessageOptions.DontRequireReceiver);
         if (BoltNetwork.isClient)
         {
             BoltEntity boltEntity = other.transform.GetComponent <BoltEntity>();
             if (boltEntity == null)
             {
                 boltEntity = other.transform.GetComponentInParent <BoltEntity>();
             }
             if (boltEntity)
             {
                 Burn burn = Burn.Create(GlobalTargets.OnlyServer);
                 burn.Entity = boltEntity;
                 burn.Send();
             }
         }
     }
 }
示例#3
0
 private void OnTriggerEnter(Collider otherObject)
 {
     if (this._owner && this._owner != otherObject.transform.root && base.transform.root != otherObject.transform.root)
     {
         if (BoltNetwork.isRunning)
         {
             GameObject gameObject = otherObject.transform.root.gameObject;
             BoltEntity component  = gameObject.GetComponent <BoltEntity>();
             if (component)
             {
                 WeaponBonus.BonusTypes bonusType = this._bonusType;
                 if (bonusType != WeaponBonus.BonusTypes.Burn)
                 {
                     if (bonusType != WeaponBonus.BonusTypes.Poison)
                     {
                         if (bonusType == WeaponBonus.BonusTypes.DouseBurn)
                         {
                             Burn burn = Burn.Create(GlobalTargets.OnlyServer);
                             burn.Entity = component;
                             burn.Send();
                         }
                     }
                     else if (Vector3.Dot(otherObject.transform.position - base.transform.position, base.transform.forward) > 0.25f)
                     {
                         Poison poison = Poison.Create(GlobalTargets.OnlyServer);
                         poison.Entity = component;
                         poison.Send();
                     }
                 }
                 else
                 {
                     Burn burn2 = Burn.Create(GlobalTargets.OnlyServer);
                     burn2.Entity = component;
                     burn2.Send();
                 }
             }
         }
         WeaponBonus.BonusTypes bonusType2 = this._bonusType;
         if (bonusType2 != WeaponBonus.BonusTypes.Poison)
         {
             if (bonusType2 != WeaponBonus.BonusTypes.DouseBurn)
             {
                 if (bonusType2 == WeaponBonus.BonusTypes.Burn)
                 {
                     Prefabs.Instance.SpawnFireHitPS(base.transform.position, Quaternion.LookRotation(base.transform.position - otherObject.transform.position));
                     otherObject.SendMessage("Burn", SendMessageOptions.DontRequireReceiver);
                     this._onHit.Invoke();
                 }
             }
             else
             {
                 Prefabs.Instance.SpawnFireHitPS(base.transform.position, Quaternion.LookRotation(base.transform.position - otherObject.transform.position));
                 otherObject.SendMessage("Douse", SendMessageOptions.DontRequireReceiver);
                 otherObject.SendMessage("Burn", SendMessageOptions.DontRequireReceiver);
                 this._onHit.Invoke();
             }
         }
         else if (otherObject.CompareTag("enemyRoot") || otherObject.CompareTag("enemyCollide") || otherObject.CompareTag("animalCollide") || otherObject.CompareTag("animalRoot"))
         {
             otherObject.SendMessage("Poison", SendMessageOptions.DontRequireReceiver);
             this._onHit.Invoke();
         }
         else if (Vector3.Dot(otherObject.transform.position - base.transform.position, base.transform.forward) > 0.25f)
         {
             otherObject.SendMessage("Poison", SendMessageOptions.DontRequireReceiver);
             this._onHit.Invoke();
         }
     }
 }