// Token: 0x060039EE RID: 14830 RVA: 0x001BAB04 File Offset: 0x001B8F04 private void start(ERefillWaterType newWaterType) { base.player.equipment.isBusy = true; this.startedUse = Time.realtimeSinceStartup; this.isUsing = true; this.refillMode = ERefillMode.REFILL; this.refill(); base.player.equipment.quality = ((newWaterType != ERefillWaterType.DIRTY) ? 100 : 0); base.player.equipment.updateQuality(); base.player.equipment.state[0] = (byte)newWaterType; base.player.equipment.updateState(); if (base.channel.isOwner) { this.msg(); } }
// Token: 0x060039EC RID: 14828 RVA: 0x001BA558 File Offset: 0x001B8958 private bool fire(bool mode, out ERefillWaterType newWaterType) { newWaterType = ERefillWaterType.EMPTY; if (base.channel.isOwner) { Ray ray = new Ray(base.player.look.aim.position, base.player.look.aim.forward); RaycastInfo raycastInfo = DamageTool.raycast(ray, 3f, RayMasks.DAMAGE_CLIENT); if (!(raycastInfo.transform != null)) { return(false); } InteractableRainBarrel component = raycastInfo.transform.GetComponent <InteractableRainBarrel>(); InteractableTank component2 = raycastInfo.transform.GetComponent <InteractableTank>(); InteractableObjectResource component3 = raycastInfo.transform.GetComponent <InteractableObjectResource>(); WaterVolume waterVolume; if (WaterUtility.isPointUnderwater(raycastInfo.point, out waterVolume)) { if (mode) { return(false); } if (this.waterType != ERefillWaterType.EMPTY) { return(false); } if (waterVolume == null) { newWaterType = ERefillWaterType.SALTY; } else { newWaterType = waterVolume.waterType; } } else if (component != null) { if (mode) { if (this.waterType != ERefillWaterType.CLEAN) { return(false); } if (component.isFull) { return(false); } newWaterType = ERefillWaterType.EMPTY; } else { if (this.waterType == ERefillWaterType.CLEAN) { return(false); } if (!component.isFull) { return(false); } newWaterType = ERefillWaterType.CLEAN; } } else if (component2 != null) { if (component2.source != ETankSource.WATER) { return(false); } if (mode) { if (this.waterType != ERefillWaterType.CLEAN) { return(false); } if (component2.amount == component2.capacity) { return(false); } newWaterType = ERefillWaterType.EMPTY; } else { if (this.waterType == ERefillWaterType.CLEAN) { return(false); } if (component2.amount == 0) { return(false); } newWaterType = ERefillWaterType.CLEAN; } } else { if (!(component3 != null)) { return(false); } if (component3.objectAsset.interactability != EObjectInteractability.WATER) { return(false); } if (mode) { if (this.waterType == ERefillWaterType.EMPTY) { return(false); } if (component3.amount == component3.capacity) { return(false); } newWaterType = ERefillWaterType.EMPTY; } else { if (this.waterType == ERefillWaterType.CLEAN || this.waterType == ERefillWaterType.DIRTY) { return(false); } if (component3.amount == 0) { return(false); } newWaterType = ERefillWaterType.DIRTY; } } base.player.input.sendRaycast(raycastInfo); } if (Provider.isServer) { if (!base.player.input.hasInputs()) { return(false); } InputInfo input = base.player.input.getInput(true); if (input == null) { return(false); } if ((input.point - base.player.look.aim.position).sqrMagnitude > 49f) { return(false); } WaterVolume waterVolume2; if (WaterUtility.isPointUnderwater(input.point, out waterVolume2)) { if (mode) { return(false); } if (this.waterType != ERefillWaterType.EMPTY) { return(false); } if (waterVolume2 == null) { newWaterType = ERefillWaterType.SALTY; } else { newWaterType = waterVolume2.waterType; } } else if (input.type == ERaycastInfoType.BARRICADE) { if (input.transform == null || !input.transform.CompareTag("Barricade")) { return(false); } InteractableRainBarrel component4 = input.transform.GetComponent <InteractableRainBarrel>(); InteractableTank component5 = input.transform.GetComponent <InteractableTank>(); if (component4 != null) { if (mode) { if (this.waterType != ERefillWaterType.CLEAN) { return(false); } if (component4.isFull) { return(false); } BarricadeManager.updateRainBarrel(component4.transform, true, true); newWaterType = ERefillWaterType.EMPTY; } else { if (this.waterType == ERefillWaterType.CLEAN) { return(false); } if (!component4.isFull) { return(false); } BarricadeManager.updateRainBarrel(component4.transform, false, true); newWaterType = ERefillWaterType.CLEAN; } } else { if (!(component5 != null)) { return(false); } if (component5.source != ETankSource.WATER) { return(false); } if (mode) { if (this.waterType != ERefillWaterType.CLEAN) { return(false); } if (component5.amount == component5.capacity) { return(false); } BarricadeManager.updateTank(input.transform, (ushort)((byte)(component5.amount + 1))); newWaterType = ERefillWaterType.EMPTY; } else { if (this.waterType == ERefillWaterType.CLEAN) { return(false); } if (component5.amount == 0) { return(false); } BarricadeManager.updateTank(input.transform, (ushort)((byte)(component5.amount - 1))); newWaterType = ERefillWaterType.CLEAN; } } } else if (input.type == ERaycastInfoType.OBJECT) { if (input.transform == null) { return(false); } InteractableObjectResource component6 = input.transform.GetComponent <InteractableObjectResource>(); if (component6 == null || component6.objectAsset.interactability != EObjectInteractability.WATER) { return(false); } if (mode) { if (this.waterType == ERefillWaterType.EMPTY) { return(false); } if (component6.amount == component6.capacity) { return(false); } ObjectManager.updateObjectResource(component6.transform, (ushort)((byte)(component6.amount + 1)), true); newWaterType = ERefillWaterType.EMPTY; } else { if (this.waterType == ERefillWaterType.CLEAN || this.waterType == ERefillWaterType.DIRTY) { return(false); } if (component6.amount == 0) { return(false); } ObjectManager.updateObjectResource(component6.transform, (ushort)((byte)(component6.amount - 1)), true); newWaterType = ERefillWaterType.DIRTY; } } } return(true); }