private void Awake() { healthMaster = GetComponent <LivingHealthMasterBase>(); playerScript = GetComponent <PlayerScript>(); objectBehaviour = GetComponent <ObjectBehaviour>(); healthStateController = GetComponent <HealthStateController>(); }
protected void AnnounceJointDislocationEvent(LivingHealthMasterBase healthMaster, BodyPart containedIn) { if (healthMaster == null) { healthMaster = HealthMaster; } if (containedIn == null) { containedIn = ContainedIn; } PlayerScript script = healthMaster.playerScript; if (IsSurface) { Chat.AddActionMsgToChat(healthMaster.gameObject, $"Your {BodyPartReadableName} dislocates from it's place!", $"{script.visibleName}'s {BodyPartReadableName} becomes visibly out of place!"); } else { Chat.AddActionMsgToChat(healthMaster.gameObject, $"You wince and hold on to your {BodyPartReadableName} as it dislocates from your " + $"{containedIn.gameObject.ExpensiveName()}.", $"{script.visibleName} holds onto " + $"{script.characterSettings.TheirPronoun(script)} {containedIn.gameObject.ExpensiveName()} in pain."); } }
protected void AnnounceJointHealEvent(LivingHealthMasterBase healthMaster, BodyPart containedIn) { if (healthMaster == null) { healthMaster = HealthMaster; } if (containedIn == null) { containedIn = ContainedIn; } PlayerScript script = healthMaster.playerScript; if (IsSurface) { Chat.AddActionMsgToChat(healthMaster.gameObject, $"Your {BodyPartReadableName} pops back into place!", $"{script.visibleName}'s {BodyPartReadableName} returns to it's original state!"); } else { Chat.AddActionMsgToChat(healthMaster.gameObject, $"You scream out loud as your {BodyPartReadableName} pops back into place.", $"{script.visibleName} screams out in pain as " + $"a loud crack can be heard from {script.characterSettings.TheirPronoun(script)} {containedIn.gameObject.ExpensiveName()}."); } }
public override void HealthMasterSet(LivingHealthMasterBase livingHealth) { bodyPart = GetComponent <BodyPart>(); playerHealth = bodyPart.HealthMaster as PlayerHealthV2; bodyPart.ModifierChange += ModifierChanged; playerHealth.OrNull()?.PlayerMove.AddModifier(this); }
/// <summary> /// Removes this body part from its host body system /// </summary> /// <param name="livingHealthMasterBase">Body to be removed from</param> public virtual void RemovedFromBody(LivingHealthMasterBase livingHealthMasterBase) { SubBodyPartRemoved(this); foreach (var bodyPartModification in BodyPartModifications) { bodyPartModification.RemovedFromBody(livingHealthMasterBase); } }
/// <summary> /// Removes this body part from its host body system /// </summary> /// <param name="livingHealthMasterBase">Body to be removed from</param> public virtual void RemovedFromBody(LivingHealthMasterBase livingHealthMasterBase) { SubBodyPartRemoved(this); foreach (var organ in OrganList) { organ.RemovedFromBody(livingHealthMasterBase); } }
public virtual void ImplantUpdate(LivingHealthMasterBase healthMaster) { foreach (ImplantProperty prop in properties) { //prop.ImplantUpdate(this, healthMaster); } bloodReagentStored -= Time.deltaTime * bloodReagentConsumed; }
public override void RemovedFromBody(LivingHealthMasterBase livingHealthMasterBase) { var dynamicItemStorage = livingHealthMasterBase.GetComponent <DynamicItemStorage>(); if (dynamicItemStorage != null) { dynamicItemStorage.Remove(this); } }
public override void RemovedFromBody(LivingHealthMasterBase livingHealthMasterBase) { StartCoroutine(RelatedStorageAddRemove(false, livingHealthMasterBase)); var dynamicItemStorage = livingHealthMasterBase.GetComponent <DynamicItemStorage>(); if (dynamicItemStorage != null) { dynamicItemStorage.Remove(this); } }
public override void RemovedFromBody(LivingHealthMasterBase livingHealth) { base.RemovedFromBody(livingHealth); var playerHealthV2 = livingHealth as PlayerHealthV2; if (playerHealthV2 != null) { playerHealthV2.PlayerMove.RemoveModifier(this); } }
public override void HealthMasterSet(LivingHealthMasterBase livingHealth) { if (InitialFatSpawned == false) { var Added = Spawn.ServerPrefab(BodyFatToInstantiate.gameObject).GameObject.GetComponent <BodyFat>(); BodyFats.Add(Added); Added.RelatedStomach = this; RelatedPart.OrganStorage.ServerTryAdd(Added.gameObject); } }
public override void HealthMasterSet(LivingHealthMasterBase livingHealth) { base.HealthMasterSet(livingHealth); var playerHealthV2 = RelatedPart.HealthMaster as PlayerHealthV2; if (playerHealthV2 != null) { playerHealthV2.PlayerMove.AddModifier(this); } }
public void TakeBluntLogic(LivingHealthMasterBase healthmaster, BodyPart containedIn) { if (currentBluntDamageLevel == TraumaDamageLevel.SMALL && DMMath.Prob(dislocationAutoHealPercent)) { currentBluntDamageLevel = TraumaDamageLevel.NONE; AnnounceJointHealEvent(healthmaster, containedIn); return; } currentBluntDamageLevel += 1; AnnounceJointDislocationEvent(healthmaster, containedIn); }
private IEnumerator RelatedStorageAddRemove(bool ToAdd, LivingHealthMasterBase livingHealthMasterBase) { yield return(null); if (ToAdd) { RelatedStorage.ServerAddObserverPlayer(livingHealthMasterBase.gameObject); } else { RelatedStorage.ServerRemoveObserverPlayer(livingHealthMasterBase.gameObject); } }
public void SetHealthMaster(LivingHealthMasterBase livingHealth) { HealthMaster = livingHealth; if (livingHealth) { playerSprites = livingHealth.GetComponent <PlayerSprites>(); } if (BodySpriteSet == false) { //If gendered part then set the sprite limb data to it if (isDimorphic) { LimbSpriteData = new ListSpriteDataSOWithOrder(); LimbSpriteData.SpriteOrder = BodyTypesSprites.SpriteOrder; LimbSpriteData.Sprites = BodyTypesSprites.BodyTypes[(int)HealthMaster.BodyType].Sprites; } else { LimbSpriteData = new ListSpriteDataSOWithOrder(); LimbSpriteData.SpriteOrder = BodyTypesSprites.SpriteOrder; if (BodyTypesSprites.BodyTypes.Count > 0) { LimbSpriteData.Sprites = BodyTypesSprites.BodyTypes[(int)BodyType.NonBinary].Sprites; } } BodySpriteSet = true; } UpdateIcons(); SetUpSystemsThis(); var dynamicItemStorage = HealthMaster.GetComponent <DynamicItemStorage>(); if (dynamicItemStorage != null) { var bodyPartUISlots = GetComponent <BodyPartUISlots>(); if (bodyPartUISlots != null) { dynamicItemStorage.Add(bodyPartUISlots); } } //TODO Make this generic \/ for mobs OrganStorage.SetRegisterPlayer(HealthMaster?.GetComponent <RegisterPlayer>()); }
private void RemoveSprites(PlayerSprites sprites, LivingHealthMasterBase livingHealth) { for (var i = RelatedPresentSprites.Count - 1; i >= 0; i--) { var bodyPartSprite = RelatedPresentSprites[i]; if (IsSurface) { sprites.SurfaceSprite.Remove(bodyPartSprite); } RelatedPresentSprites.Remove(bodyPartSprite); sprites.Addedbodypart.Remove(bodyPartSprite); Destroy(bodyPartSprite.gameObject); } livingHealth.InternalNetIDs.Remove(intName); }
/// <summary> /// Body part was added to the body /// </summary> public void BodyPartAdded(LivingHealthMasterBase livingHealth) { livingHealth.BodyPartList.Add(this); SetHealthMaster(livingHealth); livingHealth.ServerCreateSprite(this); //legs and arms getting ready to affect speed if (TryGetComponent <Limb>(out var limb)) { limb.Initialize(); } //TODO: horrible, remove -- organ prefabs have bodyparts foreach (var organ in OrganList) { var organBodyPart = organ.GetComponent <BodyPart>(); livingHealth.ServerCreateSprite(organBodyPart); } }
private void RemoveSprites(PlayerSprites sprites, LivingHealthMasterBase livingHealth) { for (var i = RelatedPresentSprites.Count - 1; i >= 0; i--) { var bodyPartSprite = RelatedPresentSprites[i]; if (IsSurface || BodyPartItemInheritsSkinColor) { sprites.SurfaceSprite.Remove(bodyPartSprite); } RelatedPresentSprites.Remove(bodyPartSprite); sprites.Addedbodypart.Remove(bodyPartSprite); SpriteHandlerManager.UnRegisterHandler(sprites.GetComponent <NetworkIdentity>(), bodyPartSprite.baseSpriteHandler); Destroy(bodyPartSprite.gameObject); } livingHealth.InternalNetIDs.Remove(intName); }
/// <summary> /// Body part was added to the body /// </summary> public void BodyPartAddHealthMaster(LivingHealthMasterBase livingHealth) { if (livingHealth.BodyPartList.Contains(this) == false) { livingHealth.BodyPartList.Add(this); } SetHealthMaster(livingHealth); livingHealth.ServerCreateSprite(this); foreach (var organ in OrganList) { organ.HealthMasterSet(HealthMaster); } foreach (var organ in containBodyParts) { organ.BodyPartAddHealthMaster(livingHealth); } }
void Awake() { healthMaster = GetComponentInParent <LivingHealthMasterBase>(); foreach (BodyPartSprites b in GetComponentsInParent <BodyPartSprites>()) { if (b.BodyPartType.Equals(BodyPartType)) { Debug.Log(b); } //TODO: Do we need to add listeners for implant removal } if (Storage == null) { Storage = GetComponent <ItemStorage>(); } Storage.ServerInventoryItemSlotSet += ImplantAdded; }
private void Awake() { healthMaster = GetComponent <LivingHealthMasterBase>(); AddFreshBlood(ReadyBloodPool, 5); }
/// <summary> /// Removes this body part from its host body system /// </summary> /// <param name="livingHealthMasterBase">Body to be removed from</param> public virtual void RemovedFromBody(LivingHealthMasterBase livingHealthMasterBase) { SubBodyPartRemoved(this); }
//Ensure removal of brain public override void RemovedFromBody(LivingHealthMasterBase livingHealth) { livingHealth.brain = null; }
//Ensure removal of brain public override void HealthMasterSet(LivingHealthMasterBase livingHealth) { livingHealth.Setbrain(this); }
public virtual void AddedToBody(LivingHealthMasterBase livingHealthMasterBase) { }
public void OnSpawnServer(SpawnInfo info) { healthMaster = GetComponentInParent <LivingHealthMasterBase>(); PlayerSprites = GetComponentInParent <PlayerSprites>(); }
public override void RemovedFromBody(LivingHealthMasterBase livingHealth) { base.RemovedFromBody(livingHealth); BodyFats.Clear(); }
public virtual void HealthMasterSet(LivingHealthMasterBase livingHealth) { }
private void Awake() { CurrentHealthDollStorage.DollStates = new List <HealthDollStorage.HealthDollState>(); livingHealthMasterBase = GetComponent <LivingHealthMasterBase>(); overallHealthSync = livingHealthMasterBase.MaxHealth; }
public virtual void RemovedFromBody(LivingHealthMasterBase livingHealth) { }