internal virtual bool attemptKnockUp(double knockupChance, StandardSpawnType type) { if (knockupChance < 0 || type is null) { return(false); } else if (this.spawnType != null) { if (spawnType.HandleNewKnockupAttempt(type, out StandardSpawnType newType)) { var oldData = spawnType.AsReadOnlyData(); spawnType = newType; source?.RaiseKnockupEvent(this, oldData); return(true); } return(false); } else if (knockupChance > 1 || Utils.Rand(1000) <= Math.Round(knockupChance * 1000)) { spawnType = type; hoursTilBirth = type.hoursToBirth; source?.RaiseKnockupEvent(this); return(true); } return(false); //if pregnant: set spawnType and birthCountdown; }
internal void Reset(bool clearEggSize = false) { spawnType = null; hoursTilBirth = 0; if (clearEggSize) { eggSize = null; } }
internal override bool attemptKnockUp(double knockupChance, StandardSpawnType type) { if (type is SpawnTypeIncludeAnal) { return(base.attemptKnockUp(knockupChance, type)); } else { return(false); } }
protected DynamicTimeReaction DoBirth() { var output = HandleBirthing(); spawnType = null; //clear pregnancy. hoursTilBirth = 0; diapauseHours = 0; doDiapauseText = false; birthCount++; source?.RaiseBirthEvent(spawnType, this); return(output); }
//clears the current pregnancy. protected internal bool AbortPregnancy() { if (!isPregnant) { return(false); } else { spawnType = null; hoursTilBirth = 0; diapauseHours = 0; doDiapauseText = false; source.RaiseKnockupEvent(this); return(true); } }
protected internal StandardSpawnData(StandardSpawnType source) : base(source?.creatureID ?? throw new ArgumentNullException(nameof(source))) { fatherName = source.father; this.spawnID = source.id; }