protected void Awake() { directional = GetComponent <Directional>(); playerHealth = GetComponent <PlayerHealthV2>(); foreach (ClothingItem c in GetComponentsInChildren <ClothingItem>()) { clothes[c.name] = c; // add listener in case clothing was changed c.OnClothingEquipped += OnClothingEquipped; } for (int i = 0; i < BodyParts.transform.childCount; i++) { //TODO: Do we need to add listeners for implant removalv bodyParts[BodyParts.transform.GetChild(i).name] = BodyParts.transform.GetChild(i).gameObject; } AddOverlayGameObjects(); directional.OnDirectionChange.AddListener(OnDirectionChange); //TODO: Need to reimplement fire stacks on players. playerHealth.EnsureInit(); playerHealth.OnClientFireStacksChange.AddListener(OnClientFireStacksChange); OnClientFireStacksChange(playerHealth.FireStacks); }
private IEnumerator Coitus(PlayerHealthV2 player) { yield return(WaitFor.Seconds(coitusTime)); _ = Pregnancy(player); yield return(WaitFor.EndOfFrame); }
protected void Awake() { directional = GetComponent <Directional>(); playerHealth = GetComponent <PlayerHealthV2>(); foreach (var clothingItem in GetComponentsInChildren <ClothingItem>()) { clothes.Add(clothingItem.Slot, clothingItem); } for (var i = 0; i < BodyParts.transform.childCount; i++) { //TODO: Do we need to add listeners for implant removalv bodyParts[BodyParts.transform.GetChild(i).name] = BodyParts.transform.GetChild(i).gameObject; } AddOverlayGameObjects(); directional.OnDirectionChange.AddListener(OnDirectionChange); //TODO: Need to reimplement fire stacks on players. playerHealth.OnClientFireStacksChange.AddListener(OnClientFireStacksChange); var healthStateController = GetComponent <HealthStateController>(); OnClientFireStacksChange(healthStateController.FireStacks); }
private bool CanUnBuckleSelf() { PlayerHealthV2 playerHealth = playerScript.playerHealth; return(!(playerHealth == null || playerHealth.ConsciousState == ConsciousState.DEAD || playerHealth.ConsciousState == ConsciousState.UNCONSCIOUS || playerHealth.ConsciousState == ConsciousState.BARELY_CONSCIOUS)); }
protected void Awake() { directional = GetComponent <Rotatable>(); playerHealth = GetComponent <PlayerHealthV2>(); foreach (var clothingItem in GetComponentsInChildren <ClothingItem>()) { clothes.Add(clothingItem.Slot, clothingItem); } AddOverlayGameObjects(); }
private static bool CanInteractByConsciousState(PlayerHealthV2 playerHealth, bool allowSoftCrit, NetworkSide side) { if (side == NetworkSide.Client) { //we only know our own conscious state, so assume true if it's not our local player if (playerHealth.gameObject != PlayerManager.LocalPlayer) { return(true); } } return(playerHealth.ConsciousState == ConsciousState.CONSCIOUS || playerHealth.ConsciousState == ConsciousState.BARELY_CONSCIOUS && allowSoftCrit); }
private async Task Pregnancy(PlayerHealthV2 player) { KillHugger(); await Task.Delay(TimeSpan.FromSeconds(pregnancyTime)); //TODO check if the larvae was removed from stomach player.ApplyDamageToBodyPart( gameObject, 200, AttackType.Internal, DamageType.Brute, BodyPartType.Chest); Spawn.ServerPrefab(larvae, player.gameObject.RegisterTile().WorldPositionServer); }
private bool CanUncuff() { PlayerHealthV2 playerHealth = thisPlayerScript.playerHealth; if (playerHealth == null || playerHealth.ConsciousState == ConsciousState.DEAD || playerHealth.ConsciousState == ConsciousState.UNCONSCIOUS || thisPlayerScript.registerTile.IsSlippingServer || positionCache != thisPlayerScript.registerTile.LocalPositionServer) { return(false); } return(true); }
private async Task Pregnancy(PlayerHealthV2 player) { await Task.Delay(TimeSpan.FromSeconds(killTime - (killTime / 8))); Chat.AddActionMsgToChat(player.gameObject, "Your stomach gurgles uncomfortably...", $"A dangerous sounding gurgle emanates from " + player.name + "!"); await Task.Delay(TimeSpan.FromSeconds(killTime / 8)); player.ApplyDamageToBodyPart( gameObject, 200, AttackType.Internal, DamageType.Brute, BodyPartType.Chest); Spawn.ServerPrefab(larvae, player.gameObject.RegisterTile().WorldPositionServer); }
protected void Awake() { directional = GetComponent <Directional>(); playerHealth = GetComponent <PlayerHealthV2>(); foreach (var clothingItem in GetComponentsInChildren <ClothingItem>()) { clothes.Add(clothingItem.Slot, clothingItem); } AddOverlayGameObjects(); directional.OnDirectionChange.AddListener(OnDirectionChange); //TODO: Need to reimplement fire stacks on players. playerHealth.OnClientFireStacksChange.AddListener(OnClientFireStacksChange); var healthStateController = GetComponent <HealthStateController>(); OnClientFireStacksChange(healthStateController.FireStacks); }
private ObserveStorageRelationship(InteractableStorage observedStorage, RegisterPlayer observer, float maxRange, Action <ObserveStorageRelationship> onObservationEnded) : base(observedStorage.GetComponent <RegisterTile>(), observer, maxRange, (rship) => onObservationEnded.Invoke(rship as ObserveStorageRelationship)) { this.ObservedStorage = observedStorage; this.ObserverPlayer = observer; //check if the observed storage is in a player's inventory, and if so, populate the fields / event hooks var rootStorage = observedStorage.ItemStorage.GetRootStorage(); this.observedPlayerMove = rootStorage.GetComponent <PlayerMove>(); if (observedPlayerMove != null) { this.observedRegisterPlayer = rootStorage.GetComponent <RegisterPlayer>(); this.observedPlayerHealth = rootStorage.GetComponent <PlayerHealthV2>(); //add listeners for non-range-based ways in which the relationship can end observedPlayerMove.OnCuffChangeServer.AddListener(OnCuffChangeServer); observedRegisterPlayer.OnSlipChangeServer.AddListener(OnSlipChangeServer); observedPlayerHealth.OnConsciousStateChangeServer.AddListener(OnConsciousStateChangeServer); } }
public void OnInventoryMoveServer(InventoryMove info) { //Wearing if (info.ToSlot != null & info.ToSlot?.NamedSlot != null) { player = info.ToRootPlayer?.PlayerScript.playerHealth; if (player != null && info.ToSlot.NamedSlot == slot) { UpdateBodyPartsArmor(); } } //taking off if (info.FromSlot != null & info.FromSlot?.NamedSlot != null) { player = info.FromRootPlayer?.PlayerScript.playerHealth; if (player != null && info.FromSlot.NamedSlot == slot) { UpdateBodyPartsArmor(remove: true); } } }