public override void OnEvent(FireAddFuelEvent evnt)
 {
     if (evnt.Target && evnt.Target.GetComponentInChildren <Fire2>())
     {
         evnt.Target.GetComponentInChildren <Fire2>().AddFuel_Complete();
     }
 }
Example #2
0
 private void OnTriggerEnter(Collider other)
 {
     if (BoltNetwork.isRunning && base.entity && (!base.entity.isAttached || !base.entity.isOwner))
     {
         return;
     }
     if (other.CompareTag("Water"))
     {
         this.Wet = true;
     }
     else if (other.CompareTag("enemyCollide"))
     {
         this.doBreak(true);
         if (this.canDouse && !this.alreadyDoused)
         {
             other.gameObject.SendMessageUpwards("douseEnemy", SendMessageOptions.DontRequireReceiver);
             other.transform.SendMessageUpwards("getAttackDirection", 3, SendMessageOptions.DontRequireReceiver);
             other.gameObject.SendMessage("getAttackerType", 4, SendMessageOptions.DontRequireReceiver);
             other.transform.SendMessageUpwards("Hit", 1, SendMessageOptions.DontRequireReceiver);
             this.alreadyDoused = true;
         }
         base.Invoke("CleanUp", 5f);
     }
     else if (other.CompareTag("FireTrigger"))
     {
         this.Wet = true;
         this.doBreak(false);
         if (BoltNetwork.isRunning)
         {
             FireAddFuelEvent fireAddFuelEvent = FireAddFuelEvent.Raise(GlobalTargets.OnlyServer);
             fireAddFuelEvent.Target       = other.GetComponentInParent <BoltEntity>();
             fireAddFuelEvent.CanSetAlight = this.isLit;
             fireAddFuelEvent.Send();
         }
         else
         {
             if (this.isLit)
             {
                 other.SendMessage("Burn");
             }
             other.SendMessage("Action_AddFuel");
         }
     }
     else if (this.DousedMolotovPrefab && other.CompareTag("BrokenMolotovUnlit"))
     {
         this.doBreak(false);
         if (!BoltNetwork.isRunning)
         {
             UnityEngine.Object.Instantiate <GameObject>(this.DousedMolotovPrefab, other.transform.position, other.transform.rotation);
             UnityEngine.Object.Destroy(other.gameObject);
         }
         else
         {
             BoltNetwork.Instantiate(this.DousedMolotovPrefab, other.transform.position, other.transform.rotation);
             BoltNetwork.Destroy(other.gameObject);
         }
         this.DousedMolotovPrefab = null;
     }
 }
Example #3
0
 public override void OnEvent(FireAddFuelEvent evnt)
 {
     if (!this.ValidateSender(evnt, SenderTypes.Any))
     {
         return;
     }
     if (evnt.Target && evnt.Target.GetComponentInChildren <Fire2>())
     {
         evnt.Target.GetComponentInChildren <Fire2>().AddFuel_Complete();
     }
 }
Example #4
0
 public override void OnEvent(FireAddFuelEvent evnt)
 {
     if (evnt.Target)
     {
         if (evnt.Target.GetComponentInChildren <Fire2>())
         {
             evnt.Target.GetComponentInChildren <Fire2>().Action_AddFuel();
         }
         if (evnt.Target.GetComponentInChildren <FireStand>())
         {
             evnt.Target.GetComponentInChildren <FireStand>().AddToFuelMP();
         }
     }
 }
Example #5
0
 public void StartAddToFuel()
 {
     base.GetComponent <AudioSource>().Play();
     this.Fuel += 150f;
     if (BoltNetwork.isRunning)
     {
         FireAddFuelEvent fireAddFuelEvent = FireAddFuelEvent.Raise(GlobalTargets.OnlyServer);
         fireAddFuelEvent.Target = this.entity;
         fireAddFuelEvent.Send();
     }
     else
     {
         base.Invoke("AddToFuel", 1f);
     }
 }
Example #6
0
    private void UpdateFueling(bool legacy)
    {
        bool flag = this._leafDelay + this.LeafDelayTime < Time.time && this.HasFuel;

        this.PositionIcon(this.IconAddLeaves);
        if (legacy && this.CookingDisabled)
        {
            int num = this.NextFoodType();
            if (this._currentFoodItemNum != num && (TheForest.Utils.Input.GetButtonDown("Rotate") || !this.HasFuel))
            {
                LocalPlayer.Sfx.PlayWhoosh();
                this._currentFoodItemNum = num;
            }
        }
        if (flag && this._proximity)
        {
            this.Widget.ShowList(this.FuelItemId, this.IconAddLeaves.transform, SideIcons.Craft);
        }
        else
        {
            this.Widget.Shutdown();
        }
        if (flag && TheForest.Utils.Input.GetButtonDown("Craft") && LocalPlayer.Inventory.RemoveItem(this.FuelItemId, 1, false, true))
        {
            LocalPlayer.Sfx.PlayItemCustomSfx(this.FuelItemId, true);
            this._leafDelay = Time.time;
            if (BoltNetwork.isRunning)
            {
                FireAddFuelEvent fireAddFuelEvent = FireAddFuelEvent.Create(GlobalTargets.Everyone);
                fireAddFuelEvent.Target = base.entity;
                fireAddFuelEvent.Send();
            }
            else
            {
                this.Action_AddFuel();
            }
        }
    }
 public override void OnEvent(FireAddFuelEvent evnt)
 {
     if (evnt.Target)
     {
         if (evnt.Target.GetComponentInChildren<Fire2>())
         {
             evnt.Target.GetComponentInChildren<Fire2>().Action_AddFuel();
         }
         if (evnt.Target.GetComponentInChildren<FireStand>())
         {
             evnt.Target.GetComponentInChildren<FireStand>().AddToFuelMP();
         }
     }
 }
 public override void OnEvent(FireAddFuelEvent evnt)
 {
     if (evnt.Target && evnt.Target.GetComponentInChildren<Fire2>())
     {
         evnt.Target.GetComponentInChildren<Fire2>().AddFuel_Complete();
     }
 }