public override int GetHashCode() { var hashCode = 1745360142; hashCode = hashCode * -1521134295 + Index.GetHashCode(); hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(Name); hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(ShortName); hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(Description); hashCode = hashCode * -1521134295 + TypeId.GetHashCode(); hashCode = hashCode * -1521134295 + SubTypeId.GetHashCode(); hashCode = hashCode * -1521134295 + EqualityComparer <int[]> .Default.GetHashCode(ClassIds); hashCode = hashCode * -1521134295 + EnhancementSetId.GetHashCode(); hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(EnhancementSetName); hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(Image); hashCode = hashCode * -1521134295 + EffectChance.GetHashCode(); hashCode = hashCode * -1521134295 + LevelMin.GetHashCode(); hashCode = hashCode * -1521134295 + LevelMax.GetHashCode(); hashCode = hashCode * -1521134295 + Unique.GetHashCode(); hashCode = hashCode * -1521134295 + MutuallyExclusiveId.GetHashCode(); hashCode = hashCode * -1521134295 + BuffMode.GetHashCode(); hashCode = hashCode * -1521134295 + EqualityComparer <EnhancementEffect[]> .Default.GetHashCode(Effects); hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(UniqueIdentifier); hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(Recipe); hashCode = hashCode * -1521134295 + Superior.GetHashCode(); return(hashCode); }
public override void Deserialize(NetworkReader reader) { this.buff = reader.ReadBuffIndex(); this.stacks = reader.ReadInt32(); this.duration = reader.ReadSingle(); this.body = reader.ReadGameObject().GetComponent <CharacterBody>(); this.mode = (BuffMode)reader.ReadByte(); this.applyDuration = this.mode.HasFlag(BuffMode.ApplyDuration); this.remove = this.mode.HasFlag(BuffMode.Remove); this.removeAll = this.mode.HasFlag(BuffMode.RemoveAll); }
public override int GetHashCode() { var hashCode = 966821394; hashCode = hashCode * -1521134295 + Mode.GetHashCode(); hashCode = hashCode * -1521134295 + BuffMode.GetHashCode(); hashCode = hashCode * -1521134295 + Id.GetHashCode(); hashCode = hashCode * -1521134295 + SubId.GetHashCode(); hashCode = hashCode * -1521134295 + Schedule.GetHashCode(); hashCode = hashCode * -1521134295 + Multiplier.GetHashCode(); if (Effect != null) { hashCode = hashCode * -1521134295 + Effect.GetHashCode(); } return(hashCode); }
IEnumerator freezeDuration() { //sfx, vfx audioz.freezeSFX.Play(); if (steer) { steer.velocity *= 0.5f; } yield return(new WaitForSeconds(3)); if (steer) { steer.velocity /= 0.5f; } debuff = BuffMode.none; //cancels after duration }
public void triggerBuff(BuffMode b) { if (currBuffProcess != null) { StopCoroutine(currBuffProcess); } debuff = b; GameObject explosionPrefab; bool parentToOther = false; if (!prefabHolder) { prefabHolder = FindObjectOfType <PrefabHolder>(); } switch (b) { case BuffMode.burn: explosionPrefab = prefabHolder.palletExplosionRed; parentToOther = true; currBuffProcess = burnDuration(); StartCoroutine(currBuffProcess); break; case BuffMode.freeze: explosionPrefab = prefabHolder.palletExplosionBlue; parentToOther = true; currBuffProcess = freezeDuration(); StartCoroutine(currBuffProcess); break; default: Debug.Log("buff case not recognized"); explosionPrefab = null; break; } GameObject effect = (explosionPrefab != null) ? Instantiate(explosionPrefab, transform.position, transform.rotation) : null; if (parentToOther) { effect.transform.parent = transform; } }
public BuffMessage(CharacterBody body, BuffIndex buff, Int32 stacks = 0, Single duration = 0f, Boolean applyDuration = false, Boolean remove = false, Boolean removeAll = false) { this.buff = buff; this.body = body; this.stacks = stacks; this.duration = duration; this.applyDuration = applyDuration; this.remove = remove; this.removeAll = removeAll; this.mode = BuffMode.None; if (this.applyDuration) { this.mode |= BuffMode.ApplyDuration; } if (this.remove) { this.mode |= BuffMode.Remove; } if (this.removeAll) { this.mode |= BuffMode.RemoveAll; } }